Skip to main content
Tools give your Agents the ability to take actions beyond just generating text. Agents can call APIs, search the web, perform calculations, and interact with external systems. Long-running tools receive ctx.signal on ToolExecutionContext — check it to stop early when cancelled. See Cancellation.
Tools work on every provider the TS SDK supports — openai/..., anthropic/..., google/..., groq/..., mistral/..., ollama/..., and more. The same tools: [...] you set on the Agent is formatted once and translated per-provider by the AI SDK backend, matching the Python SDK’s litellm-backed contract. Cross-provider tool support landed in PraisonAI PR #4412.

Quick Start

1

Simple Usage

2

With Configuration

Use tool registries and categories — see sections below.

Agent with Simple Function Tools

The easiest way to give an Agent tools — just pass plain functions directly:
Plain-function tools now work as advertised. The model returns tool arguments as a named object; the runtime maps them onto your function’s positional parameters — so getWeather receives "Paris", not "[object Object]". Tool return values are serialised as JSON (no more .toString()), and your tools array is never mutated — the constructor iterates a snapshot.
The same tools run on any provider — only the llm string changes:

Tools + Structured Output on any provider

Combine tools and outputSchema — the agent runs the tool loop first, then returns JSON matching your schema. This works on every provider:

Agent with Typed Tools

For more control, define tools with explicit schemas:

Multi-Agent Tool Sharing

Share tools across multiple Agents:

Agent with Context-Aware Tools

Tools can access Agent context:

Global Tool Registry

For the common case, register tools by name on the global registry and look them up with the Python-style register_tool / get_tool — no registry instance to pass around.
The global register_tool skips a name that is already registered (Python parity) — pass { overwrite: true } to replace it. The class method ToolRegistry.register below throws on a duplicate instead.

register options

register_tool(tool, options) and ToolRegistry.register(tool, options) share one options shape:

Scoped Registry for Agent Teams

Use a new ToolRegistry() only when you genuinely need a scoped, categorised registry — for example to split tools across an agent team.
Model definitions advertise the registration key, so a tool registered under { name: 'renamed' } dispatches correctly. Inspect a registry with registry.listTools(), registry.getAll(), registry.getTrustLevel(name), and registry.size.

Custom Tools

Build custom tools

Factory Registry

Build instances from config

Tool Errors

Missing vs broken tools

MCP Tools

MCP integration