Skip to main content
Attach plain TypeScript functions as agent tools with minimal boilerplate.

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 null are safe — you no longer need to JSON.stringify yourself.

Tools

Built-in tools

Agent

Agent configuration

MCP

External tool protocols