Skip to content

Documentation / @agentick/shared / ToolDefinition

Interface: ToolDefinition

Defined in: tools.ts:161

Simplified tool definition - platform-independent base structure. Used for direct tool execution from clients.

Backend extends this with providerOptions, libraryOptions, mcpConfig.

Extended by

Properties

audience?

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

Defined in: 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

defaultResult?

optional defaultResult: ContentBlock[]

Defined in: 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]' }]


description

description: string

Defined in: tools.ts:165

Tool description for the model


input

input: Record<string, unknown>

Defined in: tools.ts:167

JSON Schema for tool input


intent?

optional intent: ToolIntent

Defined in: 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


name

name: string

Defined in: tools.ts:163

Tool name


output?

optional output: Record<string, unknown>

Defined in: tools.ts:169

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


requiresResponse?

optional requiresResponse: boolean

Defined in: 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

timeout?

optional timeout: number

Defined in: tools.ts:201

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


type?

optional type: ToolExecutionType

Defined in: tools.ts:174

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


ui?

optional ui: object

Defined in: 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"]

Released under the ISC License.