function_tool
Agent subclass are registered
automatically; tools defined elsewhere go in Agent({ tools: [...] }).
FunctionToolOptions<P, R>
required
FunctionTool<ToolArgs<P>, R>
MCPServerStdio
A local MCP server, run as a subprocess and spoken to over stdio.Options
Record<string, string> | null
Environment for the child.
null inherits this process’s, which is usually
what you want: the server needs the same API keys you already have.string
required
The program to run, e.g.
process.execPath.string[]
Its arguments — typically the server script.
number
Seconds to wait for the connection and for each tool call. The vendor’s
default is 5, which is tight for a server that starts an interpreter; its
own examples pass 30.
string | null
Directory to run it in.
toString
string
MCPServerHTTP
A remote MCP server, reached over HTTP.Options
number
Seconds to wait for the connection.
string
required
The server’s URL.
Record<string, string> | null
Sent with every request — an API key usually lives here. Read in this
process, so the credential stays with you.
number
Seconds to wait for the session, and for each tool call.
number
Seconds a quiet stream may stay open. Long by default: an MCP server that
has nothing to say is not broken.
transport_mode
toString
string