Overview
Tool execution is the core operation in Composio, allowing you to run actions from integrated services. This guide covers executing tools manually, handling authentication, managing versions, and customizing behavior with modifiers.Basic Tool Execution
Version Control
Why Version Control Matters
Using “latest” version in manual execution can lead to unexpected behavior when new toolkit versions are released, potentially breaking your application. For production use, it’s recommended to pin specific toolkit versions.Setting Versions
There are multiple ways to control toolkit versions:- Execution Parameter
- SDK Configuration
- Environment Variable
- Skip Check (Not Recommended)
Authenticated Tool Execution
Using Connected Accounts
Most tools require authentication. Use a connected account to execute authenticated tools:connectedAccountId, Composio uses the first active connected account for the user and toolkit.
Custom Authentication
For one-off requests, you can provide custom authentication parameters:No-Auth Tools
Some tools don’t require authentication:Execution with Modifiers
Modifiers allow you to customize tool behavior before and after execution. See the Modifiers Guide for detailed information.Custom Tools Execution
Custom tools you’ve created can be executed the same way:Error Handling
Properly handle execution errors:Best Practices
Pin Versions
Always specify toolkit versions for production applications to avoid breaking changes.
Use Connected Accounts
Prefer connected accounts over custom auth params for better security and token management.
Handle Errors
Check both
result.successful and catch SDK exceptions for robust error handling.Enable Tracing
Set
allowTracing: true in execution params for debugging and monitoring.Advanced Options
Execution Tracing
Enable tracing to monitor tool execution:Text-based Execution
Some tools support natural language input:Next Steps
Authentication Flows
Learn how to set up and manage user authentication
Modifiers
Customize tool behavior with before and after execution hooks
Error Handling
Implement robust error handling strategies
File Handling
Work with file uploads and downloads in tools