Quick Start
1
Simple Usage
2
Multiple Tools
Single Agent
Multi Agents
Function-tool argument mapping
The model returns named arguments; the agent maps them to your function’s declared parameter names, so order doesn’t matter.- Named arguments map to your declared parameter names — order-independent.
- Destructured parameters (
({ city }) => ...) use a defensive fallback that passes the raw args object. - Return values are JSON-serialized before going back to the model. Objects and
nullare safe — you no longer need toJSON.stringifyyourself.
Related
Tools
Built-in tools
Agent
Agent configuration
MCP
External tool protocols

