Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/UnkleFunk/HouseMusicSwarm-/llms.txt

Use this file to discover all available pages before exploring further.

Composio is OpenSwarm’s external integration layer. Without writing a single line of API client code, every agent in the swarm gains access to Gmail, Slack, Google Calendar, HubSpot, GitHub, Stripe, and thousands of other services. Composio handles OAuth authentication, token refresh, and API call execution — the agents discover and call tools through a structured four-step sequence defined in shared_instructions.md.

Setup

Add your Composio credentials to .env:
# .env
COMPOSIO_API_KEY=your_key_here
COMPOSIO_USER_ID=your_user_id_here
Get both values at https://composio.dev. The COMPOSIO_API_KEY authenticates the OpenSwarm backend to the Composio API. The COMPOSIO_USER_ID is the identifier that ties Composio to your account’s connected apps — OAuth connections you set up in the Composio dashboard (authorizing Gmail, Slack, etc.) are stored against this user ID and retrieved automatically at runtime.

The tool discovery sequence

Agents follow a four-step sequence whenever they need to use an external integration. This sequence is defined in shared_instructions.md Section 4 and applies to every agent in the swarm:
1

ManageConnections — check authentication

Call ManageConnections first to verify that the required external service is connected and authenticated for the current user. If a connection is missing, Composio will initiate the OAuth flow. This prevents tool calls from failing mid-workflow due to auth errors.
# Check that Gmail is connected before attempting to send
ManageConnections(toolkits=["GMAIL"])
2

SearchTools — discover candidate tools

Call SearchTools with a natural-language description of the intent. Composio searches its tool registry and returns candidate tools with their schemas. Use this when you know what you want to accomplish but not the exact tool name.
SearchTools(
    queries=[{"use_case": "send an email with an attachment"}],
    session={"generate_id": True},
)
3

FindTools with include_args=True — inspect parameters

Once you have a candidate tool name, call FindTools with include_args=True to retrieve the exact parameter schema. Only set include_args=True at this stage — earlier in the workflow it wastes context tokens on schemas you may not use.
FindTools(
    tool_names=["GMAIL_SEND_EMAIL"],
    include_args=True,
)
4

ExecuteTool — run the action

Execute the tool with the validated argument structure. For simple single-tool tasks, ExecuteTool is the right choice. Use return_fields to extract only the fields you need from the response, keeping the context window lean.
ExecuteTool(
    tool_name="GMAIL_SEND_EMAIL",
    arguments={
        "to": ["user@example.com"],
        "subject": "Hello",
        "body": "Hi from OpenSwarm",
    },
    return_fields=["successful", "message_id"],
)

Programmatic tool calling

For complex multi-step workflows — where you need to call multiple tools in sequence, transform data between steps, or build conditional logic — agents can use ProgrammaticToolCalling with direct composio client calls. The composio client object and user_id are automatically injected at runtime; do not import them manually.
# Fetch available Gmail tools
tools = composio.tools.get(
    user_id=user_id,
    toolkits=["GMAIL"],
    limit=5,
)

# Execute a tool call directly
result = composio.tools.execute(
    tool_name="GMAIL_SEND_EMAIL",
    user_id=user_id,
    arguments={
        "to": ["user@example.com"],
        "subject": "Hello",
        "body": "Hi from agent",
    },
    dangerously_skip_version_check=True,
)
print(result)
Use ProgrammaticToolCalling only when ExecuteTool is not sufficient. For the majority of tasks — sending a message, creating a calendar event, submitting a ticket — the four-step sequence with ExecuteTool is cleaner and more token-efficient.

Supported toolkit families

Email

GMAIL, OUTLOOK

Calendar & Scheduling

GOOGLECALENDAR, OUTLOOK, CALENDLY

Video & Meetings

ZOOM, GOOGLEMEET, MICROSOFT_TEAMS

Messaging

SLACK, WHATSAPP, TELEGRAM, DISCORD

Documents & Notes

GOOGLEDOCS, GOOGLESHEETS, NOTION, AIRTABLE, CODA

Storage

GOOGLEDRIVE, DROPBOX

Project Management

JIRA, ASANA, TRELLO, CLICKUP, MONDAY, BASECAMP, NOTION

CRM & Sales

HUBSPOT, SALESFORCE, PIPEDRIVE, APOLLO

Payments & Accounting

STRIPE, SQUARE, QUICKBOOKS, XERO, FRESHBOOKS

Customer Support

ZENDESK, INTERCOM, FRESHDESK

Marketing

MAILCHIMP, SENDGRID

Social Media

LINKEDIN, TWITTER, INSTAGRAM

E-commerce

SHOPIFY

Signatures

DOCUSIGN

Design & Collaboration

FIGMA, CANVA, MIRO

Development

GITHUB

Analytics

AMPLITUDE, MIXPANEL, SEGMENT

Best practices

These guidelines come directly from shared_instructions.md Section 5.5 and apply to any agent using Composio:
  • Save intermediate results to variables — if a tool returns a list of records you’ll reference later, store it rather than calling the tool again. Repeated API calls slow down the workflow and consume rate limit quota.
  • Explore the returned data structure before extracting fields — Composio responses vary by toolkit. Run a FindTools or an initial ExecuteTool call without return_fields first, inspect the shape of the response, then add return_fields to subsequent calls to extract only what you need.
  • Format outputs for readability — agents should return clean, human-readable summaries rather than raw JSON blobs. Include only the fields that are relevant to the current task; strip internal metadata the user doesn’t need.
  • Use SearchTools before FindTools when the exact tool name is unknown — attempting FindTools with a guess at a tool name wastes a round-trip if the name is wrong. The search step is fast and returns exact names you can pass directly to FindTools.
  • Prefer ExecuteTool over ProgrammaticToolCallingExecuteTool handles auth context, error formatting, and field extraction automatically. Only drop down to ProgrammaticToolCalling (i.e., direct composio.tools.execute(...) calls) when you need conditional logic or data transformation between multiple tool calls.
Composio authentication is per-user. The COMPOSIO_USER_ID in your .env determines which OAuth connections are available. If you connect Gmail in the Composio dashboard under user ID user_abc, then set COMPOSIO_USER_ID=user_abc in .env — the agents will have access to that Gmail account. If you change the user ID, the previously authorized connections will not be available and ManageConnections will prompt for re-authentication.

Build docs developers (and LLMs) love