Providers
Providers are the bridge between Composio’s tool ecosystem and AI frameworks. They transform Composio tools into framework-specific formats and handle execution, enabling seamless integration with OpenAI, Anthropic, LangChain, and other AI platforms.Overview
The base provider classes define the contract for all Composio provider implementations. Providers come in two types: agentic and non-agentic, each serving different use cases. Source:ts/packages/core/src/provider/BaseProvider.ts
Provider Types
Agentic Providers
Agentic providers are designed for AI frameworks that need to execute tools autonomously. They wrap tools with execution functions that the AI can call directly. Examples: OpenAI, Anthropic, LangChain, Google AI, Vercel AINon-Agentic Providers
Non-agentic providers are for frameworks that only need tool schemas without execution logic. The framework receives tool definitions, and you handle execution separately. Examples: Raw JSON schema providers, documentation generatorsProvider Architecture
Base Provider Class
All providers extend fromBaseProvider and implement specific methods:
Agentic Provider Contract
Non-Agentic Provider Contract
Using Providers
Initialize Composio with a Provider
The provider must be specified when initializing Composio if you plan to use the
tools.get() method. Without a provider, you’ll receive a ComposioProviderNotDefinedError.Getting Provider-Wrapped Tools
Using Raw Tools with Manual Provider
Execute Tool Function
Agentic providers receive anexecuteTool function for each tool:
How It Works
- Provider wraps tools with the execute function
- AI framework calls the tool
- Execute function calls Composio’s tool execution API
- Results are returned to the AI framework
Global Execute Tool Method
Providers can execute any tool using the globalexecuteTool method:
The
executeTool method is injected by the Composio SDK and provides the same functionality as composio.tools.execute(). It automatically skips version checks for provider-controlled execution.Creating Custom Providers
Custom Agentic Provider
Custom Non-Agentic Provider
Provider Options and Modifiers
Providers support execution modifiers for customizing behavior:Available Providers
Composio provides official providers for popular AI frameworks:- @composio/openai - OpenAI function calling
- @composio/anthropic - Anthropic Claude tools
- @composio/google - Google Gemini function calling
- @composio/langchain - LangChain tools
- @composio/vercel - Vercel AI SDK
- @composio/mastra - Mastra framework
Example: Using Multiple Providers
Version Control in Providers
Providers automatically skip version checks during execution because they typically fetch tools right before use, ensuring they have the latest version.
Error Handling
Common provider-related errors:ComposioProviderNotDefinedError- No provider specified when usingtools.get()ComposioGlobalExecuteToolFnNotSetError- Execute function not properly injected- Framework-specific errors from tool execution
Best Practices
- Provider Selection: Choose agentic providers for autonomous AI agents, non-agentic for manual control
- Reuse Instances: Create one Composio instance per provider type and reuse it
- Version Pinning: Pin toolkit versions in production for stability
- Error Handling: Implement proper error handling for tool execution failures
- Modifiers: Use modifiers for logging, metrics, and transformation
Related Resources
- Tools - Understanding tool execution
- Custom Tools - Creating custom tools that work with providers
- Connected Accounts - Managing user authentication for tools
- Provider Documentation: