Skip to content

AIDK API Reference / aidk-shared / ToolDefinition

Interface: ToolDefinition ​

Defined in: packages/shared/src/tools.ts:156

Simplified tool definition - platform-independent base structure. Used for direct tool execution from clients.

Backend extends this with providerOptions, libraryOptions, mcpConfig.

Extended by ​

Properties ​

PropertyTypeDescriptionDefined in
defaultResult?ContentBlock[]Default result to use when requiresResponse is false. Returned immediately for render tools that don't need client feedback. Default: [{ type: 'text', text: '[{name} rendered on client]' }]packages/shared/src/tools.ts:195
descriptionstringTool description for the modelpackages/shared/src/tools.ts:160
inputRecord<string, unknown>JSON Schema for tool inputpackages/shared/src/tools.ts:162
intent?ToolIntentTool intent describes what the tool does (render, action, compute). Used by clients to determine how to render/handle tool calls. Default: COMPUTEpackages/shared/src/tools.ts:175
namestringTool namepackages/shared/src/tools.ts:158
output?Record<string, unknown>Optional JSON Schema for tool output (for validation/documentation)packages/shared/src/tools.ts:164
requiresResponse?booleanWhether execution should wait for client response. Only applicable for CLIENT type tools. - true: Server pauses and waits for tool_result from client (e.g., forms) - false: Server continues immediately with defaultResult (e.g., charts) Default: falsepackages/shared/src/tools.ts:183
timeout?numberTimeout in milliseconds when waiting for client response. Only applicable when requiresResponse is true. Default: 30000 (30 seconds)packages/shared/src/tools.ts:189
type?ToolExecutionTypeTool execution type. Determines how the tool is executed. Default: SERVER (engine executes tool.run on server).packages/shared/src/tools.ts:169

Released under the MIT License.