Tool
Internal representation of a registered tool.
Created by tools.function() from a ToolDef.
Properties
Section titled “Properties”description
Section titled “description”description:
string
Description the LLM uses to decide when to call this tool.
execute
Section titled “execute”execute: (
args,ctx) =>Promise<unknown>
Execution function. Receives validated args and a context reference.
Parameters
Section titled “Parameters”Record<string, unknown>
unknown
Returns
Section titled “Returns”Promise<unknown>
jsonSchema
Section titled “jsonSchema”jsonSchema:
Record<string,unknown>
JSON Schema representation sent to the LLM.
name:
string
Tool name sent to the LLM.
requireApproval?
Section titled “requireApproval?”
optionalrequireApproval?:boolean| ((args) =>boolean|Promise<boolean>)
Whether this tool requires human approval before execution. Set by tools.function() or tools.mcp().
schema?
Section titled “schema?”
optionalschema?:ZodType<any,ZodTypeDef,any>
Zod schema for runtime input validation. Optional for MCP tools (which use jsonSchema directly).
timeout?
Section titled “timeout?”
optionaltimeout?:number
Maximum execution time in ms. Default: 30000.