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 ​
| Property | Type | Description | Defined 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 |
description | string | Tool description for the model | packages/shared/src/tools.ts:160 |
input | Record<string, unknown> | JSON Schema for tool input | packages/shared/src/tools.ts:162 |
intent? | ToolIntent | Tool intent describes what the tool does (render, action, compute). Used by clients to determine how to render/handle tool calls. Default: COMPUTE | packages/shared/src/tools.ts:175 |
name | string | Tool name | packages/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? | boolean | Whether 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: false | packages/shared/src/tools.ts:183 |
timeout? | number | Timeout in milliseconds when waiting for client response. Only applicable when requiresResponse is true. Default: 30000 (30 seconds) | packages/shared/src/tools.ts:189 |
type? | ToolExecutionType | Tool execution type. Determines how the tool is executed. Default: SERVER (engine executes tool.run on server). | packages/shared/src/tools.ts:169 |