@devries-cameron20 / composio Mirror · read-only / commits / efe7ad87a
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 18:15 UTC

toolrouter

Sushmithamallesh committed Nov 25, 2025 at 10:11 UTC efe7ad87af47560db4dc90575323462e68fb7697
13 files changed +118 -240
fern/pages/src/tool-router/authentication-flows.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Authentication Flows
3 +image: "https://og.composio.dev/api/og?title=Authentication Flows"
4 +description: "Master in-chat and programmatic authentication patterns for production-ready Tool Router applications."
5 +keywords: "authentication, oauth, in-chat auth, programmatic auth, session authorize, callback urls"
6 +subtitle: "Production-ready authentication patterns"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/framework-examples.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Framework Examples
3 +image: "https://og.composio.dev/api/og?title=Framework Examples"
4 +description: "Integration examples for OpenAI, Anthropic, Vercel AI SDK, LangChain, and other popular frameworks."
5 +keywords: "framework examples, openai integration, anthropic, vercel ai, langchain, crewai, mastra"
6 +subtitle: "Real-world examples for every major AI framework"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/mcp-integration.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: MCP Integration
3 +image: "https://og.composio.dev/api/og?title=MCP Integration"
4 +description: "Universal compatibility with Claude Desktop, Continue.dev, and any MCP client through Tool Router."
5 +keywords: "mcp integration, claude desktop, continue dev, mcp server, universal compatibility"
6 +subtitle: "Framework-agnostic integration via Model Context Protocol"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/meta-tools.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Meta-Tools
3 +image: "https://og.composio.dev/api/og?title=Tool Router Meta-Tools"
4 +description: "Discover the 4 intelligent meta-tools: SEARCH_TOOLS, EXECUTE, WORKBENCH, and MANAGE_CONNECTIONS."
5 +keywords: "meta-tools, search tools, execute tools, workbench, manage connections, tool router"
6 +subtitle: "Four meta-tools to rule them all"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/native-sdk.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Native SDK
3 +image: "https://og.composio.dev/api/og?title=Native SDK Integration"
4 +description: "Production features including file upload/download, execution hooks, and performance optimization."
5 +keywords: "native sdk, typescript sdk, python sdk, file upload, execution hooks, production features"
6 +subtitle: "Direct SDK integration for production applications"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/overview.mdx new
+8
@@ -0,0 +1,8 @@
1 +---
2 +title: Tool Router
3 +image: "https://og.composio.dev/api/og?title=Tool%20Router"
4 +description: ""
5 +keywords: ""
6 +subtitle: ""
7 +hide-nav-links: false
8 +---
\ No newline at end of file
fern/pages/src/tool-router/permissions.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Permissions
3 +image: "https://og.composio.dev/api/og?title=Tool Router Permissions"
4 +description: "Control read/write permissions and action-level blocking for enterprise-grade security."
5 +keywords: "permissions, security, read-only mode, write permissions, action blocking, enterprise security"
6 +subtitle: "Fine-grained control over tool access and actions"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/quick-start.mdx deleted
-240
@@ -1,240 +0,0 @@
1 ----
2 -title: Tool Router Quick Start
3 -image: "https://og.composio.dev/api/og?title=Tool%20Router%20Quick%20Start" # image for socials
4 -keywords: ''
5 -subtitle: 'Learn how to use tool router to route tool calls to the correct tool.'
6 -hide-nav-links: false
7 ----
8 -
9 -
10 -Tool Router automatically discovers, authenticates, and executes the right tools for any task. It's an experimental feature that handles the entire workflow—from finding relevant tools across 500+ integrations to managing authentication and parallel execution.
11 -
12 -This is what powers complex agentic products like [Rube](https://rube.app).
13 -
14 -## Quick start
15 -
16 -<Steps toc={true}>
17 - <Step title="Install SDKs">
18 - Install the Composio SDK and OpenAI Agents SDK:
19 -
20 - <CodeGroup>
21 -
22 - ```bash Python
23 - pip install composio_openai_agents openai-agents
24 - ```
25 -
26 - ```bash TypeScript
27 - pnpm install @composio/core @composio/openai-agents @openai/agents
28 - ```
29 -
30 - </CodeGroup>
31 -
32 - Get your Composio API key from [settings](https://platform.composio.dev/?next_page=/settings) and set it as an environment variable:
33 -
34 - ```bash
35 - export COMPOSIO_API_KEY="your-api-key"
36 - ```
37 - </Step>
38 -
39 - <Step title="Create Tool Router session">
40 - Initialize Composio and create a session for your user:
41 -
42 - <Tip icon="info">
43 - **Authentication is handled automatically**
44 -
45 - Tool Router provides auth URLs when needed. For production, consider [pre-configuring authentication](/docs/authenticating-tools).
46 - </Tip>
47 -
48 - <CodeGroup>
49 -
50 - <SnippetCode
51 - src="fern/snippets/tool-router/python/quickstart.py"
52 - startLine={1}
53 - endLine={16}
54 - title="Python"
55 - />
56 -
57 - <SnippetCode
58 - src="fern/snippets/tool-router/typescript/quickstart.ts"
59 - startLine={1}
60 - endLine={18}
61 - title="TypeScript"
62 - />
63 -
64 - </CodeGroup>
65 -
66 - This generates a secure MCP endpoint URL that your AI agent will use to access Tool Router.
67 -
68 - <Tip icon="info">
69 - **What are sessions?**
70 -
71 - Sessions are designed for security. Each presigned URL contains user authentication credentials and should never be stored long-term or exposed to the client. Generate a new URL for each conversation.
72 - </Tip>
73 - </Step>
74 -
75 - <Step title="Set up your agent">
76 - Configure an OpenAI agent with the Tool Router MCP endpoint:
77 -
78 - <CodeGroup>
79 -
80 - <SnippetCode
81 - src="fern/snippets/tool-router/python/quickstart.py"
82 - startLine={17}
83 - endLine={33}
84 - title="Python"
85 - />
86 -
87 - <SnippetCode
88 - src="fern/snippets/tool-router/typescript/quickstart.ts"
89 - startLine={20}
90 - endLine={30}
91 - title="TypeScript"
92 - />
93 -
94 - </CodeGroup>
95 - </Step>
96 -
97 - <Step title="Run your agent">
98 - Execute the agent with a task:
99 -
100 - <CodeGroup>
101 -
102 - <SnippetCode
103 - src="fern/snippets/tool-router/python/quickstart.py"
104 - startLine={34}
105 - endLine={42}
106 - title="Python"
107 - />
108 -
109 - <SnippetCode
110 - src="fern/snippets/tool-router/typescript/quickstart.ts"
111 - startLine={32}
112 - endLine={41}
113 - title="TypeScript"
114 - />
115 -
116 - </CodeGroup>
117 - </Step>
118 -</Steps>
119 -
120 -### Visualizing Tool Router in MCP Inspector
121 -
122 -You can inspect the session URL in any MCP client. Here's what it looks like in the MCP Inspector:
123 -
124 -<Frame>
125 - <img src="../../../assets/images/tool-router/inspector.jpeg" alt="Tool Router Inspector" />
126 -</Frame>
127 -
128 -## How Tool Router works
129 -
130 -The Tool Router executes a three-phase workflow:
131 -
132 -**1. Discovery**
133 -Searches across all available tools to find ones matching your task. Returns relevant toolkits with their descriptions, schemas, and connection status.
134 -
135 -**2. Authentication**
136 -Checks if the user has an active connection to the required toolkit. If not, creates an auth config and returns a connection URL using [Auth Link](/docs/authenticating-tools#hosted-authentication-connect-link). The user completes authentication through this link.
137 -
138 -**3. Execution**
139 -Loads authenticated tools into context and executes them. Supports parallel execution across multiple tools for efficiency.
140 -
141 -These phases are orchestrated through a set of meta tools, which handle search, planning, connection management, execution, and remote workbench.
142 -
143 -<Warning>
144 -**Experimental Feature**
145 -
146 -Tool Router is under active development. The meta tools, their schemas, parameters, and behaviors are subject to change as we iterate and improve the functionality. We recommend not using these tools individually.
147 -</Warning>
148 -
149 -## Works with any MCP client
150 -
151 -The session URL you created is a standard MCP endpoint. Use it with any framework that supports MCP:
152 -
153 -<Info>
154 -Tool Router uses Streamable HTTP transport for MCP communication. Make sure your MCP client supports HTTP transport (most do).
155 -</Info>
156 -
157 -<CardGroup cols={2}>
158 - <Card
159 - title="Vercel AI SDK"
160 - icon={<img src="../../../assets/images/vercel-logo.svg" width="24" height="24" />}
161 - href="https://ai-sdk.dev/cookbook/next/mcp-tools#mcp-tools"
162 - >
163 - Use experimental_createMCPClient with StreamableHTTPClientTransport to integrate with Next.js apps
164 - </Card>
165 - <Card
166 - title="Claude"
167 - icon={<img src="../../../assets/images/anthropic-logo.svg" width="24" height="24" />}
168 - href="https://docs.claude.com/en/docs/agents-and-tools/remote-mcp-servers"
169 - >
170 - Connect remote MCP servers through Anthropic's MCP connector API
171 - </Card>
172 - <Card
173 - title="LangChain"
174 - icon={<img src="../../../assets/images/langgraph-logo.svg" width="24" height="24" />}
175 - href="https://docs.langchain.com/oss/python/langchain/mcp"
176 - >
177 - Load Tool Router tools using langchain_mcp_adapters for Python workflows
178 - </Card>
179 -</CardGroup>
180 -
181 -<Note>
182 -The necessary scaffolding will be integrated into existing provider abstractions before Tool Router is generally available.
183 -</Note>
184 -
185 -## Customization
186 -
187 -### Restricting toolkits
188 -
189 -Control which toolkits are available by specifying them during session creation. This limits which apps your users can access.
190 -
191 -<CodeGroup>
192 -```python
193 -session = composio.experimental.tool_router.create_session(
194 - user_id="user@example.com",
195 - toolkits=["github", "slack", "gmail"]
196 -)
197 -```
198 -
199 -```typescript
200 -const session = await composio.experimental.toolRouter.createSession(
201 - "user@example.com",
202 - {
203 - toolkits: ["github", "slack", "gmail"]
204 - }
205 -);
206 -```
207 -</CodeGroup>
208 -
209 -
210 -### Manual connection management
211 -
212 -For advanced use cases, you can manually manage connections:
213 -
214 -<CodeGroup>
215 -```python
216 -session = composio.experimental.tool_router.create_session(
217 - user_id="user@example.com",
218 - toolkits=[{"toolkit": "gmail", "auth_config_id": "ac_nnn"}],
219 - manually_manage_connections=True
220 -)
221 -```
222 -
223 -```typescript
224 -const session = await composio.experimental.toolRouter.createSession(
225 - "user@example.com",
226 - {
227 - toolkits: [{ toolkit: 'gmail', authConfigId: 'ac_nnn' }],
228 - manuallyManageConnections: true
229 - }
230 -);
231 -```
232 -</CodeGroup>
233 -
234 -When you pass the auth config ID, you can use regular Composio functions to connect accounts and check authentication status.
235 -
236 -## Feedback
237 -
238 -This is still very experimental and work in progress, and you can expect the contracts to change and improve as we iterate on this. That said, we would love to hear your feedback on this.
239 -
240 -Give us feedback on this GitHub discussion [here](https://github.com/ComposioHQ/composio/discussions/2011).
fern/pages/src/tool-router/quickstart.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Quickstart
3 +image: "https://og.composio.dev/api/og?title=Tool Router Quickstart"
4 +description: "Get started with Tool Router in 5 minutes. Build an email analyzer that works with both MCP and Native SDK."
5 +keywords: "tool router quickstart, composio quickstart, mcp integration, native sdk, email analyzer"
6 +subtitle: "Build your first Tool Router application in 5 minutes"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/sessions.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Sessions
3 +image: "https://og.composio.dev/api/og?title=Tool Router Sessions"
4 +description: "Learn about ephemeral, user-scoped execution contexts that power Tool Router's intelligent orchestration."
5 +keywords: "tool router sessions, ephemeral sessions, user context, execution environment, session management"
6 +subtitle: "Ephemeral, isolated execution contexts for your AI agents"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/toolkit-management.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Toolkit Management
3 +image: "https://og.composio.dev/api/og?title=Toolkit Management"
4 +description: "Complete control over toolkit configuration, discovery, and management in Tool Router sessions."
5 +keywords: "toolkit management, toolkit configuration, toolkit discovery, auth configs, connection management"
6 +subtitle: "Configure and control your toolkits with precision"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/understanding-tool-router.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: Understanding Tool Router
3 +image: "https://og.composio.dev/api/og?title=Understanding Tool Router"
4 +description: "Learn why 4 meta-tools beat 800+ individual tools for context management, token efficiency, and intelligent execution."
5 +keywords: "meta-tools, tool router architecture, context management, token optimization, intelligent routing"
6 +subtitle: "Why meta-tools are the future of AI tool orchestration"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file
fern/pages/src/tool-router/white-labeling.mdx new
+10
@@ -0,0 +1,10 @@
1 +---
2 +title: White-Labeling
3 +image: "https://og.composio.dev/api/og?title=White-Labeling Tool Router"
4 +description: "Use custom OAuth credentials and branded authentication screens for your Tool Router applications."
5 +keywords: "white-label, custom oauth, branded auth, custom credentials, enterprise branding"
6 +subtitle: "Your brand, your auth, your way"
7 +hide-nav-links: false
8 +---
9 +
10 +{/* Content will be written by the user */}
\ No newline at end of file