Documentation / @agentick/core / ToolDefinition
Interface: ToolDefinition
Defined in: core/src/tool/tool.ts:678
Tool definition in provider-compatible format (JSON Schema). This is what gets passed to model adapters.
Extends the base ToolDefinition from @agentick/shared with backend-specific fields.
Extends
Properties
audience?
optionalaudience:"user"|"model"|"all"
Defined in: shared/src/tools.ts:187
Controls who sees this tool.
- "model" (default): Sent to the model for tool_use
- "user": User dispatch only (hidden from model)
- "all": Both model and user dispatch
Inherited from
defaultResult?
optionaldefaultResult:ContentBlock[]
Defined in: shared/src/tools.ts:207
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]' }]
Inherited from
description
description:
string
Defined in: shared/src/tools.ts:165
Tool description for the model
Inherited from
input
input:
Record<string,unknown>
Defined in: shared/src/tools.ts:167
JSON Schema for tool input
Inherited from
intent?
optionalintent:ToolIntent
Defined in: shared/src/tools.ts:180
Tool intent describes what the tool does (render, action, compute). Used by clients to determine how to render/handle tool calls. Default: COMPUTE
Inherited from
libraryOptions?
optionallibraryOptions:LibraryToolOptions
Defined in: core/src/tool/tool.ts:692
Library-specific tool configurations. Keyed by library name (e.g., 'ai-sdk', 'langchain', 'llamaindex'). Used by adapters for library-specific tool behavior (timeouts, callbacks, etc.). Each adapter can extend this type using module augmentation.
mcpConfig?
optionalmcpConfig:object
Defined in: core/src/tool/tool.ts:697
MCP-specific configuration (only relevant if type === 'mcp'). Contains connection info and MCP server details.
Index Signature
[key: string]: any
serverName?
optionalserverName:string
serverUrl?
optionalserverUrl:string
transport?
optionaltransport:"websocket"|"sse"|"stdio"|"in-process"
name
name:
string
Defined in: shared/src/tools.ts:163
Tool name
Inherited from
output?
optionaloutput:Record<string,unknown>
Defined in: shared/src/tools.ts:169
Optional JSON Schema for tool output (for validation/documentation)
Inherited from
providerOptions?
optionalproviderOptions:ProviderToolOptions
Defined in: core/src/tool/tool.ts:685
Provider-specific tool configurations. Keyed by provider name (e.g., 'openai', 'google', 'anthropic'). Adapters will use their provider-specific config when converting tools. Each adapter can extend this type using module augmentation.
requiresResponse?
optionalrequiresResponse:boolean
Defined in: shared/src/tools.ts:195
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
Inherited from
ToolDefinition.requiresResponse
timeout?
optionaltimeout:number
Defined in: shared/src/tools.ts:201
Timeout in milliseconds when waiting for client response. Only applicable when requiresResponse is true. Default: 30000 (30 seconds)
Inherited from
type?
optionaltype:ToolExecutionType
Defined in: shared/src/tools.ts:174
Tool execution type. Determines how the tool is executed. Default: SERVER (engine executes tool.run on server).
Inherited from
ui?
optionalui:object
Defined in: shared/src/tools.ts:217
MCP App UI metadata. When present, the host should mount an interactive app (iframe) alongside the tool execution. The tool still executes normally and returns a result — the app is a VIEW of that execution.
Per the MCP Apps spec, each tool call with a resourceUri creates a new View instance. The host sends tool-input (arguments) and tool-result (execution output) to the app via the ext-apps bridge protocol.
resourceUri?
optionalresourceUri:string
URI of the MCP App resource to mount (e.g., "ui://knowify/dashboard")
visibility?
optionalvisibility: ("model"|"app")[]
Controls who can call this tool.
- "model": callable by the LLM (included in tools/list to model)
- "app": callable by apps from the same MCP server (hidden from model) Default: ["model", "app"]