Skip to content

Defined in: hub/src/tools.ts:43

A website capability offered to the agent as an MCP tool. It executes on the hub instance that receives the call (WebSocket: the node holding the machine’s connection; HTTP: whichever instance the call’s POST reaches), as the session’s owner (ctx.user); the machine only ever receives its name, description and JSON Schema. Each call runs at most once: a retried call gets the stored result, and a call whose instance died mid-handler fails with “Site tool “” timed out on the website. Please try again.” instead of running again — keep handlers within your platform’s duration limit and, where you can, idempotent.

Type Parameter Default type
I any
Property Type Description Defined in
description string - hub/src/tools.ts:46
input ZodType<I> Arguments are validated (and parsed: defaults, transforms) with this before handler runs. hub/src/tools.ts:48
name string ^[a-z][a-z0-9_]{0,47}$, no __. hub/src/tools.ts:45
requiresConfirmation? boolean When true the user confirms each call in the website UI first. hub/src/tools.ts:50
handler(args, ctx): Promise<
| string
| object
| {
content: (
| {
text: string;
type: "text";
}
| {
json: unknown;
type: "json";
})[];
isError?: boolean;
}>;

Defined in: hub/src/tools.ts:56

Returns a ToolCallResult, a string (→ one text block) or any other JSON value (→ one json block). A throw becomes a tool_failed error carrying its message, which the user and the model see: throw user-safe messages (no stack traces, SQL or secrets).

Parameter Type
args I
ctx ToolContext

Promise< | string | object | { content: ( | { text: string; type: "text"; } | { json: unknown; type: "json"; })[]; isError?: boolean; }>