Skip to content

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?

optional audience: "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

ToolDefinition.audience


defaultResult?

optional defaultResult: 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

ToolDefinition.defaultResult


description

description: string

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

Tool description for the model

Inherited from

ToolDefinition.description


input

input: Record<string, unknown>

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

JSON Schema for tool input

Inherited from

ToolDefinition.input


intent?

optional intent: 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

ToolDefinition.intent


libraryOptions?

optional libraryOptions: 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?

optional mcpConfig: 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?

optional serverName: string

serverUrl?

optional serverUrl: string

transport?

optional transport: "websocket" | "sse" | "stdio" | "in-process"


name

name: string

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

Tool name

Inherited from

ToolDefinition.name


output?

optional output: Record<string, unknown>

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

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

Inherited from

ToolDefinition.output


providerOptions?

optional providerOptions: 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?

optional requiresResponse: 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?

optional timeout: 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

ToolDefinition.timeout


type?

optional type: 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

ToolDefinition.type


ui?

optional ui: 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?

optional resourceUri: string

URI of the MCP App resource to mount (e.g., "ui://knowify/dashboard")

visibility?

optional visibility: ("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"]

Inherited from

ToolDefinition.ui

Released under the ISC License.