Executing Tools
LLMs on their own can only do generation. Tool calling changes that by letting them interact with external services. Instead of just drafting an email, the model can call GMAIL_SEND_EMAIL
to actually send it. The tool’s results feed back to the LLM, closing the loop so it can decide, act, observe, and adapt.
In Composio, every tool is a single API action—fully described with schema, parameters, and return type. Tools live inside toolkits like Gmail, Slack, or GitHub, and Composio handles authentication and user scoping.
User Scoping: All tools are scoped to a specific user - that’s why every example includes a
user_id
. Each user must authenticate with their respective services (Gmail, Calendar, etc.)
before executing tools. Learn more about authentication →
Using Chat Completions
Use the Composio SDK with providers like OpenAI, Anthropic, and Google AI. To learn how to set-up these providers, see Providers.
Using Agentic Frameworks
Agentic frameworks automatically handle the tool execution loop. Composio provides support for frameworks like this by making sure the tools are formatted into the correct objects for the agentic framework to execute.
Direct Tool execution
In case you just want to call a tool without using any framework or LLM provider, you can use the execute
method directly.
Finding tool arguments: In the Auth Configs tab → Select your toolkit → Tools & Triggers → Select the tool to see its required and optional parameters, types, and descriptions.
Proxy Execute — Manually calling toolkit APIs
You can proxy requests to any supported toolkit API and let Composio inject the authentication state. This is useful when you need an API endpoint that isn’t available as a predefined tool.
The endpoint
can be a relative path or absolute URL. Composio uses the connected_account_id
to determine the toolkit and resolve relative paths against the appropriate base URL.
Need an API that isn’t supported by any Composio toolkit, or want to extend an existing one? Learn how to create custom tools.
Automatic File Handling
Composio handles file operations automatically. Pass file paths to tools that need them, and get local file paths back from tools that return files.
File Upload
Pass local file paths, URLs, or File objects to tools that accept files:
File Download
When tools return files, Composio downloads them to the local directory and provides file path in the response: When tools return files, Composio downloads them to the local directory and provides the file path in the response:
Disabling Auto File Handling
You can disable automatic file handling when initializing the TypeScript SDK. When disabled, handle file uploads and downloads manually using files.upload
and files.download
: