Skip to content

Documentation / @agentick/core / ToolDefinition

Interface: ToolDefinition ​

Defined in: core/src/tool/tool.ts:662

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? ​

optional audience: "user" | "model" | "all"

Defined in: shared/src/tools.ts:171

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 ​

ToolDefinition.audience


defaultResult? ​

optional defaultResult: ContentBlock[]

Defined in: shared/src/tools.ts:191

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 ​

ToolDefinition.defaultResult


description ​

description: string

Defined in: shared/src/tools.ts:149

Tool description for the model

Inherited from ​

ToolDefinition.description


input ​

input: Record<string, unknown>

Defined in: shared/src/tools.ts:151

JSON Schema for tool input

Inherited from ​

ToolDefinition.input


intent? ​

optional intent: ToolIntent

Defined in: shared/src/tools.ts:164

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 ​

ToolDefinition.intent


libraryOptions? ​

optional libraryOptions: LibraryToolOptions

Defined in: core/src/tool/tool.ts:676

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? ​

optional mcpConfig: object

Defined in: core/src/tool/tool.ts:681

MCP-specific configuration (only relevant if type === 'mcp'). Contains connection info and MCP server details.

Index Signature ​

[key: string]: any

serverName? ​

optional serverName: string

serverUrl? ​

optional serverUrl: string

transport? ​

optional transport: "websocket" | "sse" | "stdio"


name ​

name: string

Defined in: shared/src/tools.ts:147

Tool name

Inherited from ​

ToolDefinition.name


output? ​

optional output: Record<string, unknown>

Defined in: shared/src/tools.ts:153

Optional JSON Schema for tool output (for validation/documentation)

Inherited from ​

ToolDefinition.output


providerOptions? ​

optional providerOptions: ProviderToolOptions

Defined in: core/src/tool/tool.ts:669

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? ​

optional requiresResponse: boolean

Defined in: shared/src/tools.ts:179

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? ​

optional timeout: number

Defined in: shared/src/tools.ts:185

Timeout in milliseconds when waiting for client response. Only applicable when requiresResponse is true. Default: 30000 (30 seconds)

Inherited from ​

ToolDefinition.timeout


type? ​

optional type: ToolExecutionType

Defined in: shared/src/tools.ts:158

Tool execution type. Determines how the tool is executed. Default: SERVER (engine executes tool.run on server).

Inherited from ​

ToolDefinition.type

Released under the ISC License.