functionTool
name is required. The
argument schema can be a Zod schema (input, which takes precedence, or
parameters directly) or a plain JSON Schema (parameters); Zod schemas
are converted to JSON Schema.
isFunctionTool
obj is a FunctionTool (has valid _toolInfo).
getToolInfo
FunctionTool
A callable tool: a function that runs the tool, with its FunctionToolInfoLike metadata attached as_toolInfo. Create one with functionTool.
FunctionToolInfo
Concrete carrier for tool metadata; see FunctionToolInfoLike.Constructor
ToolChoice
How the model is allowed to use tools on a turn.buildOpenaiSchema
buildGeminiSchema
buildNovaSonicSchema
MCPServerStdio
Describe an MCP server run as a local subprocess communicating over stdio.Constructor
Executable to launch.
Command-line arguments passed to the MCP server process. Default:
[].Environment variables for the MCP server process. Default:
{}.MCPServerHTTP
Describe an MCP server reached over HTTP.Constructor
Base URL of the MCP server.
HTTP headers sent with each request to the MCP server. Default:
{}.DTMFHandler
Create a DTMFHandler.Constructor
onDigit
callback to fire each time the given single digit is received.
onSequence
callback to fire when the recent digit stream ends with sequence.
VoiceMailDetector
Create a VoiceMailDetector.Constructor
LLM used for classification. Default:
null.Callback fired on detection. Default:
null.Detection window in seconds. Default:
2.0. Overridden by VoiceMailDetectorOptions.maxDetectionSeconds when set.Custom classifier prompt; falls back to the built-in prompt when empty. Default:
''.Hang up automatically when voicemail is detected. Default:
false.Confidence threshold (0-1) required to count as a detection. Default:
1.0.Maximum detection window in seconds; takes precedence over VoiceMailDetectorOptions.duration. Default:
null.