Documentation / @agentick/core / ToolMetadata
Interface: ToolMetadata<TInput, TOutput>
Defined in: core/src/tool/tool.ts:705
Type Parameters
TInput
TInput = any
TOutput
TOutput = any
Properties
aliases?
optionalaliases:string[]
Defined in: core/src/tool/tool.ts:796
Alternative names for user dispatch (e.g. ["mount"] for "add-dir").
audience?
optionalaudience:ToolAudience
Defined in: core/src/tool/tool.ts:793
Controls who sees this tool. "model" (default) = model only, "user" = dispatch only, "all" = both.
confirmationMessage?
optionalconfirmationMessage:string| (input) =>string
Defined in: core/src/tool/tool.ts:762
Message to show user when requesting confirmation. Can be a string or a function that receives the input. Default: "Allow {tool_name} to execute?"
confirmationPreview()?
optionalconfirmationPreview: (input,deps) =>Promise<Record<string,unknown>>
Defined in: core/src/tool/tool.ts:766
Async preview metadata for confirmation UI (e.g. diff).
Parameters
input
any
deps
any
Returns
Promise<Record<string, unknown>>
defaultResult?
optionaldefaultResult:ContentBlock[]
Defined in: core/src/tool/tool.ts:744
Default result to use when requiresResponse is false. Returned immediately for render tools that don't need client feedback. Default: [{ type: 'text', text: '[{tool_name} rendered on client]' }]
description
description:
string
Defined in: core/src/tool/tool.ts:707
displaySummary()?
optionaldisplaySummary: (input) =>string
Defined in: core/src/tool/tool.ts:764
Short summary string for tool call indicators.
Parameters
input
any
Returns
string
input
input:
ZodSchema<TInput>
Defined in: core/src/tool/tool.ts:708
intent?
optionalintent:ToolIntent
Defined in: core/src/tool/tool.ts:724
Tool intent describes what the tool does (render, action, compute). Used by clients to determine how to render/handle tool calls. Default: COMPUTE
libraryOptions?
optionallibraryOptions:LibraryToolOptions
Defined in: core/src/tool/tool.ts:780
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:785
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: core/src/tool/tool.ts:706
output?
optionaloutput:ZodSchema<TOutput>
Defined in: core/src/tool/tool.ts:713
Optional Zod schema for output validation. Used for type-safe tool composition and workflow orchestration.
providerOptions?
optionalproviderOptions:ProviderToolOptions
Defined in: core/src/tool/tool.ts:773
Provider-specific tool configurations. Keyed by provider name (e.g., 'openai', 'google', 'anthropic'). Preserved when converting to ToolDefinition. Each adapter can extend this type using module augmentation.
requiresConfirmation?
optionalrequiresConfirmation:boolean| (input) =>boolean|Promise<boolean>
Defined in: core/src/tool/tool.ts:756
Whether execution requires user confirmation before running. Applies to any tool type (SERVER, CLIENT, MCP).
- boolean: Always require (true) or never require (false)
- function: Conditional - receives input, returns whether confirmation needed. Can be async to check persisted "always allow" state. Use Context.get() inside the function to access execution context.
Default: false
requiresResponse?
optionalrequiresResponse:boolean
Defined in: core/src/tool/tool.ts:732
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
timeout?
optionaltimeout:number
Defined in: core/src/tool/tool.ts:738
Timeout in milliseconds when waiting for client response. Only applicable when requiresResponse is true. Default: 30000 (30 seconds)
type?
optionaltype:ToolExecutionType
Defined in: core/src/tool/tool.ts:718
Tool execution type. Determines how the tool is executed. Default: SERVER (engine executes tool.run on server).
ui?
optionalui:object
Defined in: core/src/tool/tool.ts:802
MCP App UI metadata. When present, tool calls emit ui on the tool_result_start event, signaling the host to mount an app iframe.
resolveContent()?
optionalresolveContent: () =>Promise<string|undefined>
Optional resolver for app HTML content — see ToolMetadata.ui.resolveContent
Returns
Promise<string | undefined>
resourceUri?
optionalresourceUri:string
visibility?
optionalvisibility: ("model"|"app")[]