Skip to main content

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 AI

Non-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 generators

Provider Architecture

Base Provider Class

All providers extend from BaseProvider 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 an executeTool function for each tool:

How It Works

  1. Provider wraps tools with the execute function
  2. AI framework calls the tool
  3. Execute function calls Composio’s tool execution API
  4. Results are returned to the AI framework

Global Execute Tool Method

Providers can execute any tool using the global executeTool 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.
For manual version control:

Error Handling

Common provider-related errors:
  • ComposioProviderNotDefinedError - No provider specified when using tools.get()
  • ComposioGlobalExecuteToolFnNotSetError - Execute function not properly injected
  • Framework-specific errors from tool execution

Best Practices

  1. Provider Selection: Choose agentic providers for autonomous AI agents, non-agentic for manual control
  2. Reuse Instances: Create one Composio instance per provider type and reuse it
  3. Version Pinning: Pin toolkit versions in production for stability
  4. Error Handling: Implement proper error handling for tool execution failures
  5. Modifiers: Use modifiers for logging, metrics, and transformation