Skip to content

Tool Wrappers

Tool wrappers are adapter classes that translate between external tool formats and the ToolRegistry's standardized interface. Each wrapper implements call_sync() and call_async() from the base class.

Available Wrappers

Wrapper Source Reference
BaseToolWrapper Abstract base class for all wrappers Defines call_sync() / call_async() contract
MCPToolWrapper MCP servers Multi-transport, multi-content-type support
OpenAPIToolWrapper REST APIs HTTP client with GET/POST/PUT/DELETE
LangChainToolWrapper LangChain tools Bridges _run() / _arun() to ToolRegistry

Execution Model

All wrappers support automatic execution mode detection:

# Sync context → calls call_sync()
result = wrapper(a=5, b=3)

# Async context → calls call_async()
result = await wrapper(a=5, b=3)

See Also