Composio

Learn how to use Composio with Composio

Overview

SLUG: COMPOSIO

Description

Composio enables AI Agents and LLMs to authenticate and integrate with various tools via function calling.

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Composio toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["COMPOSIO"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Execute Composio Tool

Description

Execute a tool using the composio api.

Action Parameters

allow_destructive
boolean
arguments
objectRequired
connected_account_id
string
tool_slug
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Multi Execute Composio Tools

Description

Executes two or more independent tool calls in parallel using the composio api.

Action Parameters

allow_destructive
boolean
connected_account_id
string
tools
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Search Composio Tools

Description

Search for tools across toolkits for specific use cases. use this when unsure what tool to use or to discover new tools.

Action Parameters

check_connections
booleanDefaults to True
exploratory_query
boolean
toolkits
array
use_case
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Ask Oracle

Description

Static helper that returns a comprehensive system prompt describing how to plan and execute tasks using the available composio tools and workflows. no inputs required; simply call to retrieve the prompt. always call this after the search tool is executed -- it will provide the best context on how to proceed, chain tools, and execute the task end-to-end. relevant tools referenced by the prompt: 1. composio search tools 2. composio multi execute tool 3. composio execute code 4. composio manage connections 5. composio bash tool

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Check active connection (deprecated)

Description

Deprecated: use check active connections instead for bulk operations. check active connection status for a toolkit or specific connected account id. returns connection details if active, or required parameters for establishing connection if none exists. active connections enable agent actions on the toolkit.

Action Parameters

connected_account_id
string
toolkit
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Check multiple active connections

Description

Check active connection status for multiple toolkits or specific connected account ids. returns connection details if active, or required parameters for establishing connection if none exists. active connections enable agent actions on toolkits.

Action Parameters

requests
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Plan

Description

Important - always call this after manage connections tool is executed. you are an efficient workflow builder, your job is to guide the llm to create a plan for the given use case

Action Parameters

difficulty
stringRequired
known_fields
stringRequired
primary_tool_slugs
arrayRequired
reasoning
stringRequired
related_tool_slugs
array
use_case
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Download S3 File

Description

Download a file from a public s3 (or r2) url to a local path.

Action Parameters

local_path
string
s3_url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Enable trigger

Description

Enable a specific trigger for the authenticated user.

Action Parameters

config_params
object
connected_account_id
stringRequired
toolkit_slug
stringRequired
trigger_name
stringRequired
user_id
stringDefaults to default

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Execute agent

Description

Execute complex workflows using ai agent reasoning between multiple tool calls. use this for: complex multi-step workflows requiring reasoning, error handling and retry logic. use composio multi execute tool instead for: simple parallel operations, batch operations on similar data (e.g., fetch 5 emails, get 10 sent messages, retrieve multiple user profiles), independent tool calls that don't need each other's results, or bulk operations where all parameters are known upfront. performance: agent calls add ~2-3 seconds overhead. use for workflows >3 tools or requiring conditional logic. avoid for simple parameter passing.

Action Parameters

context
object
entity_id
stringDefaults to default
metadata
object
primary_task
stringRequired
tool_names
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Tool Dependency Graph

Description

Get the dependency graph for a given tool, showing related parent tools that might be useful. this action calls the composio labs dependency graph api to retrieve tools that are commonly used together with or before the specified tool. this helps discover related tools and understand common workflows.

Action Parameters

tool_name
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get required parameters for connection

Description

Gets the required parameters for connecting to a toolkit via initiate connection. returns the exact parameter names and types needed for initiate connection's parameters field. supports api keys, oauth credentials, connection fields, and hybrid authentication scenarios. if has default credentials is true, you can call initiate connection with empty parameters for seamless oauth flow.

Action Parameters

toolkit
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get response schema

Description

Retrieves the response schema for a specified composio tool. this action fetches the complete response schema definition for any valid composio tool, returning it as a dictionary that describes the expected response structure.

Action Parameters

tool
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Initiate connection

Description

Initiate a connection to a toolkit with comprehensive authentication support. supports all authentication scenarios: 1. composio default oauth (no parameters needed) 2. custom oauth (user's client id/client secret) 3. api key/bearer token authentication 4. basic auth (username/password) 5. hybrid scenarios (oauth + connection fields like site name) 6. connection-only fields (subdomain, api key at connection level) 7. no authentication required automatically detects and validates auth config vs connection fields, provides helpful error messages for missing parameters.

Action Parameters

parameters
object
toolkit
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List toolkits

Description

List all the available toolkits on composio with filtering options.

Action Parameters

category
string
min_tools
integer
name_filter
string
no_auth_only
boolean
size
integerDefaults to 10

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List triggers

Description

List available triggers and their configuration schemas.

Action Parameters

toolkit_names
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Manage connection

Description

Manage a connection to a toolkit with comprehensive authentication support. supports all authentication scenarios: 1. composio default oauth (no parameters needed) 2. custom oauth (user's client id/client secret) 3. api key/bearer token authentication 4. basic auth (username/password) 5. hybrid scenarios (oauth + connection fields like site name) 6. connection-only fields (subdomain, api key at connection level) 7. no authentication required automatically detects and validates auth config vs connection fields, provides helpful error messages for missing parameters. notifies properly if a connection already exists or if authentication params are required from the user.

Action Parameters

parameters
object
reinitiate
boolean
toolkit
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Manage connections

Description

Manage connections to multiple toolkits with comprehensive authentication support. processes each toolkit independently and returns aggregated results supporting all auth types: oauth (default/custom), api key, bearer token, basic auth, hybrid scenarios, and no-auth. features batch processing, independent error handling, selective reinitialization, and custom auth parameters per toolkit. returns individual results and summary statistics.

Action Parameters

reinitiate_all
boolean
reinitiate_specific
array
specify_custom_auth
object
toolkits
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Run bash commands

Description

Run bash commands

Action Parameters

command
stringRequired
timeout
integerDefaults to 300

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Execute Code

Description

Execute code

Action Parameters

code_to_execute
stringRequired
disabled_tools
array
file_path
string
thought_process
stringRequired
timeout
integerDefaults to 280

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Retrieve Toolkits

Description

Toolkits are like github, linear, gmail, etc. tools are like send email, create issue, etc programmatic functions that can be used to perform the action. not all toolkits support all tools. some toolkits support only a subset of tools that might be possible to perform with that toolkit. use this action to retrieve the toolkits that can be used to perform the action. this list is only probabilistic. retrieve toolkits for a specified usecase. so for example, if use case is to "send an email" this action will return all the toolkits that can be used to send email. simiarly if use case is to "create a github issue" this action will return all the toolkits that can be used to create a github issue. after using this, to confirm whether the toolkit can indeed potentially support the use case, use the action retrieve actions.

Action Parameters

category
stringRequired
page
integerDefaults to 1
page_size
integerDefaults to 10

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Search agent

Description

Discover tools and analyze dependencies for complex workflows using ai agent. this action uses an ai agent to intelligently search for tools across toolkits and create optimized execution sequences with detailed instructions.

Action Parameters

user_query
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Wait for connection

Description

Wait for connections to be established for given toolkits.

Action Parameters

mode
stringDefaults to any
timeout_seconds
integerDefaults to 300
toolkits
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired