Skip to main content

Interface: ToolDefinition<Args, Result>

Defined in: packages/client/src/types.ts:12

Type Parameters​

Args​

Args = Record<string, unknown>

Result​

Result = unknown

Properties​

annotations?​

optional annotations?: ToolAnnotations

Defined in: packages/client/src/types.ts:27

Hints for the browser's agents when the tool is offered through WebMCP (exposeTools).


description​

description: string

Defined in: packages/client/src/types.ts:15


execute?​

optional execute?: (args, context) => Result | Promise<Result>

Defined in: packages/client/src/types.ts:25

Runs in the page. The result is sent to the model as JSON; a thrown error is sent as { error } so the model can react.

Omit it for a tool the visitor answers: the call waits, with its part in awaiting-input state, until the UI calls conversation.submitToolResult(callId, result).

Parameters​

args​

Args

context​

ToolContext

Returns​

Result | Promise<Result>


inputSchema​

inputSchema: JsonSchema

Defined in: packages/client/src/types.ts:16


name​

name: string

Defined in: packages/client/src/types.ts:14

[a-zA-Z0-9_-], unique within a request.