Provider architecture
A provider does two things:- Tool format transformation: converts Composio tools into the format your AI platform understands.
- Platform-specific compatibility: adds helper methods for executing tool calls and handling responses.
Each type extends a different abstract base class:
Quick start
Scaffold a working provider with themake create-provider script:
python/providers/<provider-name>/ (or your output directory) with a pyproject.toml, a provider template, a demo script, a README, and type annotations. The template runs as-is. You implement the tool transformation for your platform, and you can keep your provider in your own repository.
The generated structure:
- Navigate to the provider directory:
cd python/providers/<provider-name>. - Install in development mode:
uv pip install -e .. - Implement your provider logic in
composio_<provider-name>/provider.py. - Test with the demo script:
python <provider-name>_demo.py.
Creating a non-agentic provider
A non-agentic provider extendsNonAgenticProvider and implements two methods: wrap_tool (transform one tool) and wrap_tools (transform a collection). Add helper methods to execute tool calls in your platform’s format.
Creating an agentic provider
An agentic provider extendsAgenticProvider. Because the platform calls tools itself, wrap_tool receives an execute_tool function that you wrap into a callable the framework can invoke directly.
Using your custom provider
Pass an instance of your provider toComposio, and every tool you fetch comes back in your format.
Non-agentic provider
You drive the loop: fetch tools, send them to the platform, then hand the response back to the provider to execute the calls.Agentic provider
The framework runs the loop. Fetch tools, attach them to an agent, and the agent calls them itself.Best practices
- Keep providers focused: each provider integrates with one platform.
- Handle errors gracefully: catch and transform errors from tool execution.
- Follow platform conventions: adopt the naming and structure of the target platform.
- Use type annotations: lean on Python’s typing for IDE support and documentation.
- Cache transformed tools: store transformed tools when it helps performance.
- Add helper methods: provide convenient methods for common platform operations.
- Document your provider: include docstrings and usage examples.
- Set a meaningful provider name: the
nameparameter is used for telemetry and debugging.