SiteTool
View as MarkdownDefined 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 “
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
I |
any |
Properties
Section titled “Properties”Methods
Section titled “Methods”handler()
Section titled “handler()”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
args |
I |
ctx |
ToolContext |
Returns
Section titled “Returns”Promise<
| string
| object
| {
content: (
| {
text: string;
type: "text";
}
| {
json: unknown;
type: "json";
})[];
isError?: boolean;
}>