App Connectors — Connect Your Agent to 1000+ Apps
Connect your AI agent to Gmail, Slack, GitHub, Notion, Google Calendar, LinkedIn, HubSpot, Stripe, and 1000+ more apps via Composio OAuth.
Setup
On first use, check credentials:
CODEBLOCK0
Required:
- -
COMPOSIO_API_KEY — Project-scoped API key from Composio
If not in env, check the framework's secrets provider (vault, secrets.json, .env). If missing, stop and report to the operator.
API Reference
Base URL: https://backend.composio.dev/api
Auth header: INLINECODE2
List Connected Apps
Use the v1 REST API to get all active connections for the current entity:
CODEBLOCK1
Returns { "items": [...] } — each item has appName, status, id.
Discover Tools (COMPOSIOSEARCHTOOLS)
Find the right tool for a task. Returns matching tools, schemas, connection status, and execution plan.
CODEBLOCK2
Key fields in response:
- -
primary_tool_slugs — best matching tools - INLINECODE8 — input schemas for each tool
- INLINECODE9 — whether there's an active connection
- INLINECODE10 — common mistakes to avoid
Rules:
- - 1 query = 1 tool action (max 7 queries per call)
- Include the app name in the query when the user specifies one
- Reuse
session.id from the first response in subsequent calls
Connect an App (COMPOSIOMANAGECONNECTIONS)
If has_active_connection is false, or the user wants to connect a new app:
CODEBLOCK3
Response statuses:
- -
active — ready to use, no action needed - INLINECODE15 — returns
redirect_url → send to user to complete OAuth - INLINECODE17 — error (often: wrong toolkit slug)
Common toolkit slugs: gmail, outlook, slack, github, notion, clickup, linkedin, googlecalendar, googledrive, googlesheets, jira, trello, hubspot, figma, discord, airtable, stripe, youtube, calendly, supabase, asana, dropbox, INLINECODE40
Note: slugs are lowercase, no underscores (e.g. googlecalendar not google_calendar).
Execute Tools (COMPOSIOMULTIEXECUTE_TOOL)
Only after connection is active:
CODEBLOCK4
Rules:
- - Never invent tool slugs or argument fields — only use what
SEARCH_TOOLS returned - Batch independent tools in a single call (max 50)
- Verify connection is active before executing
Get Full Schemas (COMPOSIOGETTOOL_SCHEMAS)
When SEARCH_TOOLS returns a schemaRef instead of full input_schema:
CODEBLOCK5
/apps Command
When the user types /apps:
- 1. List connected apps using the v1 REST API (
/v1/connectedAccounts?user_uuid=default&showActiveOnly=true) - Display as a clean list — one line per app,
🟢 prefix, human-readable name:
🟢 Gmail
🟢 LinkedIn
🟢 ClickUp
🟢 Notion
If none connected: "No apps connected yet."
- 3. End with a prompt: "To connect a new app, type its name."
- When the user types an app name, call
COMPOSIO_MANAGE_CONNECTIONS with the matching slug, get the redirect_url, and send it as a clickable link.
Display name mapping (slug → display):
gmail → Gmail, outlook → Outlook, googlecalendar → Google Calendar, googledrive → Google Drive, googlesheets → Google Sheets, linkedin → LinkedIn, notion → Notion, clickup → ClickUp, slack → Slack, github → GitHub, jira → Jira, trello → Trello, hubspot → HubSpot, figma → Figma, discord → Discord, airtable → Airtable, stripe → Stripe, youtube → YouTube, calendly → Calendly, supabase → Supabase, asana → Asana, dropbox → Dropbox, twitter → Twitter/X, shopify → Shopify
For unknown slugs, capitalize the first letter.
Agent Commands
| User says | What to do |
|---|
| INLINECODE76 | List connected apps → prompt to connect |
| "Connect Slack" |
MANAGE_CONNECTIONS with
["slack"] → send OAuth link |
| "Send an email to X" |
SEARCH_TOOLS → check connection →
MULTI_EXECUTE_TOOL |
| "Disconnect Slack" | Use
MANAGE_CONNECTIONS |
References
应用连接器 — 将您的智能体连接到1000多个应用
通过Composio OAuth,将您的AI智能体连接到Gmail、Slack、GitHub、Notion、Google日历、LinkedIn、HubSpot、Stripe以及1000多个其他应用。
设置
首次使用时,检查凭证:
bash
检查环境变量
[ -n $COMPOSIO
APIKEY ] && echo ✅ API密钥 || echo ⏳ 未设置
必需项:
- - COMPOSIOAPIKEY — 来自Composio的项目级API密钥
如果环境变量中不存在,请检查框架的密钥提供程序(vault、secrets.json、.env)。如果缺失,请停止并向操作员报告。
API参考
基础URL:https://backend.composio.dev/api
认证头:x-api-key: $COMPOSIOAPIKEY
列出已连接的应用
使用v1 REST API获取当前实体的所有活跃连接:
bash
curl -s https://backend.composio.dev/api/v1/connectedAccounts?user_uuid=default&showActiveOnly=true \
-H x-api-key: $COMPOSIOAPIKEY
返回 { items: [...] } — 每个项目包含 appName、status、id。
发现工具(COMPOSIOSEARCHTOOLS)
为任务找到合适的工具。返回匹配的工具、模式、连接状态和执行计划。
bash
curl -s -X POST https://backend.composio.dev/api/v3/tools/execute/COMPOSIOSEARCHTOOLS \
-H x-api-key: $COMPOSIOAPIKEY \
-H Content-Type: application/json \
-d {
arguments: {
queries: [
{
use_case: 通过gmail发送邮件,
known_fields: 收件人姓名:John
}
],
session: { generate_id: true }
}
}
响应中的关键字段:
- - primarytoolslugs — 最佳匹配的工具
- toolschemas — 每个工具的输入模式
- toolkitconnectionstatuses — 是否存在活跃连接
- knownpitfalls — 需要避免的常见错误
规则:
- - 1个查询 = 1个工具操作(每次调用最多7个查询)
- 当用户指定应用名称时,在查询中包含该应用名称
- 在后续调用中复用第一次响应的 session.id
连接应用(COMPOSIOMANAGECONNECTIONS)
如果 hasactiveconnection 为 false,或者用户想要连接新应用:
bash
curl -s -X POST https://backend.composio.dev/api/v3/tools/execute/COMPOSIOMANAGECONNECTIONS \
-H x-api-key: $COMPOSIOAPIKEY \
-H Content-Type: application/json \
-d {
arguments: {
toolkits: [gmail]
}
}
响应状态:
- - active — 准备就绪,无需操作
- initiated — 返回 redirect_url → 发送给用户完成OAuth
- failed — 错误(通常:工具包slug错误)
常用工具包slug: gmail、outlook、slack、github、notion、clickup、linkedin、googlecalendar、googledrive、googlesheets、jira、trello、hubspot、figma、discord、airtable、stripe、youtube、calendly、supabase、asana、dropbox、twitter
注意:slug为小写,无下划线(例如 googlecalendar 而非 google_calendar)。
执行工具(COMPOSIOMULTIEXECUTE_TOOL)
仅在连接活跃后:
bash
curl -s -X POST https://backend.composio.dev/api/v3/tools/execute/COMPOSIOMULTIEXECUTE_TOOL \
-H x-api-key: $COMPOSIOAPIKEY \
-H Content-Type: application/json \
-d {
arguments: {
tools: [
{
toolslug: GMAILSEND_EMAIL,
arguments: {
to: john@example.com,
subject: 你好,
body: 欢迎!
}
}
],
syncresponseto_workbench: false
}
}
规则:
- - 切勿自行编造工具slug或参数字段 — 仅使用 SEARCH_TOOLS 返回的内容
- 在单次调用中批量处理独立工具(最多50个)
- 执行前确认连接处于活跃状态
获取完整模式(COMPOSIOGETTOOL_SCHEMAS)
当 SEARCHTOOLS 返回 schemaRef 而非完整的 inputschema 时:
bash
curl -s -X POST https://backend.composio.dev/api/v3/tools/execute/COMPOSIOGETTOOL_SCHEMAS \
-H x-api-key: $COMPOSIOAPIKEY \
-H Content-Type: application/json \
-d {
arguments: {
toolslugs: [GMAILSEND_EMAIL]
}
}
/apps 命令
当用户输入 /apps 时:
- 1. 列出已连接的应用,使用v1 REST API(/v1/connectedAccounts?user_uuid=default&showActiveOnly=true)
- 以清晰列表显示 — 每行一个应用,🟢 前缀,人类可读名称:
🟢 Gmail
🟢 LinkedIn
🟢 ClickUp
🟢 Notion
如果未连接任何应用:尚未连接任何应用。
- 3. 以提示结束:要连接新应用,请输入其名称。
- 当用户输入应用名称时,使用匹配的slug调用 COMPOSIOMANAGECONNECTIONS,获取 redirect_url,并将其作为可点击链接发送。
显示名称映射(slug → 显示名称):
gmail → Gmail、outlook → Outlook、googlecalendar → Google日历、googledrive → Google云端硬盘、googlesheets → Google表格、linkedin → LinkedIn、notion → Notion、clickup → ClickUp、slack → Slack、github → GitHub、jira → Jira、trello → Trello、hubspot → HubSpot、figma → Figma、discord → Discord、airtable → Airtable、stripe → Stripe、youtube → YouTube、calendly → Calendly、supabase → Supabase、asana → Asana、dropbox → Dropbox、twitter → Twitter/X、shopify → Shopify
对于未知的slug,首字母大写。
智能体命令
| 用户说 | 执行操作 |
|---|
| /apps | 列出已连接的应用 → 提示连接 |
| 连接Slack |
MANAGE_CONNECTIONS 使用 [slack] → 发送OAuth链接 |
| 发送邮件给X | SEARCH
TOOLS → 检查连接 → MULTIEXECUTE_TOOL |
| 断开Slack | 使用 MANAGE_CONNECTIONS |
参考