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.llm string changes:
Tools + Structured Output on any provider
Combinetools 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-styleregister_tool / get_tool — no registry instance to pass around.
register options
register_tool(tool, options) and ToolRegistry.register(tool, options) share one options shape:
Scoped Registry for Agent Teams
Use anew ToolRegistry() only when you genuinely need a scoped, categorised registry — for example to split tools across an agent team.
{ name: 'renamed' } dispatches correctly. Inspect a registry with registry.listTools(), registry.getAll(), registry.getTrustLevel(name), and registry.size.
Related
Custom Tools
Build custom tools
Factory Registry
Build instances from config
Tool Errors
Missing vs broken tools
MCP Tools
MCP integration

