The tool's input schema: any Standard Schema that can convert to JSON Schema — a Zod object schema (the documented default) or e.g. an ArkType type. Defaults to a permissive record schema so tools without inputs don't need an explicit type argument.
Human-readable description shown to the LLM.
OptionalinputSchema for the tool's input, shown to the LLM and used to validate each
call's arguments before execute runs. Named after the Vercel AI SDK's
tool({ inputSchema }).
Function that executes the tool and returns a result. The result is
JSON-serialized for the LLM and the client, and capped at
MAX_TOOL_RESULT_CHARS (4000) characters — longer results are
trimmed and end with a [truncated] marker.
Definition of a custom tool that the agent can invoke.
Tools are the primary way to extend agent capabilities. Each tool has a description (shown to the LLM), an optional input schema, and an
executefunction that runs inside the sandboxed worker.Example