@devries-cameron20 / composio Mirror · read-only / commits / 9ffa29a1d
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

fix quickstart

Sushmithamallesh committed Nov 27, 2025 at 06:38 UTC 9ffa29a1da5f984980d8c42a9d9bcb3c6a031f07
1 file changed +280 -1
fern/pages/src/tool-router/quickstart.mdx
+280 -1
@@ -1,8 +1,287 @@
1 ---
2 title: Quickstart
3 image: "https://og.composio.dev/api/og?title=Tool%20Router%20Quickstart"
4 -description: "Get started with Tool Router. Build an AI agent that uses tool router either as an MCP server or a Native tool"
4 +description: "Build an AI agent with access to 1000+ tools"
5 keywords: "tool router quickstart, quickstart"
6 hide-nav-links: false
7 ---
8
9 +Build an agent that summarizes your Gmail inbox.
10 +
11 +<Tabs>
12 +<Tab title="OpenAI (Python)">
13 +
14 +<Steps>
15 +<Step title="Install Composio SDK">
16 +```bash
17 +pip install composio openai-agents composio-openai-agents
18 +```
19 +</Step>
20 +
21 +<Step title="Create session for user">
22 +Sessions are ephemeral, user-scoped and manage connections and tools for that user. See [Session Management](/docs/user-management) and [Configuring Toolkits](/tool-router/configuring-toolkits).
23 +
24 +<Info>
25 +Replace `your-api-key` with your Composio API key from the [developer dashboard](https://platform.composio.dev/?next_page=/settings). Replace `user_123` with the ID of the user in your system.
26 +</Info>
27 +```python
28 +from composio import Composio
29 +from composio_openai_agents import OpenAIAgentsProvider
30 +
31 +composio = Composio(
32 + api_key="your-api-key",
33 + provider=OpenAIAgentsProvider()
34 +)
35 +session = composio.create(user_id="user_123")
36 +```
37 +</Step>
38 +
39 +<Step title="Run agent">
40 +When the agent needs authentication, it will prompt the user to connect. To pre-authenticate users, see [Manual Authentication](/tool-router/manual-authentication).
41 +```python
42 +from agents import Agent, Runner
43 +
44 +agent = Agent(
45 + name="Assistant",
46 + instructions="You are a helpful assistant.",
47 + tools=session.tools()
48 +)
49 +
50 +result = Runner.run_sync(
51 + agent,
52 + "Summarize all the emails in my Gmail inbox today"
53 +)
54 +print(result.final_output)
55 +```
56 +
57 +To use OpenAI Agents SDK with Tool Router MCP instead, see [Using with MCP Clients](/tool-router/using-with-mcp-clients#openai).
58 +</Step>
59 +</Steps>
60 +
61 +</Tab>
62 +
63 +<Tab title="OpenAI (TypeScript)">
64 +
65 +<Steps>
66 +<Step title="Install Composio SDK">
67 +```bash
68 +npm install @composio/core @composio/openai-agents @openai/agents
69 +```
70 +</Step>
71 +
72 +<Step title="Create session for user">
73 +Sessions are ephemeral, user-scoped and manage connections and tools for that user. See [Session Management](/docs/user-management) and [Configuring Toolkits](/tool-router/configuring-toolkits).
74 +
75 +<Info>
76 +Replace `your-api-key` with your Composio API key from the [developer dashboard](https://platform.composio.dev/?next_page=/settings). Replace `user_123` with the ID of the user in your system.
77 +</Info>
78 +```typescript
79 +import { Composio } from "@composio/core";
80 +import { OpenAIAgentsProvider } from "@composio/openai-agents";
81 +
82 +const composio = new Composio({
83 + apiKey: "your-api-key",
84 + provider: new OpenAIAgentsProvider(),
85 +});
86 +const { tools } = await composio.create("user_123");
87 +```
88 +</Step>
89 +
90 +<Step title="Run agent">
91 +When the agent needs authentication, it will prompt the user to connect. To pre-authenticate users, see [Manual Authentication](/tool-router/manual-authentication).
92 +```typescript
93 +import { Agent, run } from "@openai/agents";
94 +
95 +const agent = new Agent({
96 + name: "Assistant",
97 + instructions: "You are a helpful assistant.",
98 + tools: await tools(),
99 +});
100 +
101 +const result = await run(
102 + agent,
103 + "Summarize all the emails in my Gmail inbox today"
104 +);
105 +console.log(result.finalOutput);
106 +```
107 +
108 +To use OpenAI Agents SDK with Tool Router MCP instead, see [Using with MCP Clients](/tool-router/using-with-mcp-clients#openai).
109 +</Step>
110 +</Steps>
111 +
112 +</Tab>
113 +
114 +<Tab title="Anthropic (Python)">
115 +
116 +<Steps>
117 +<Step title="Install Composio SDK">
118 +```bash
119 +pip install composio anthropic-agents composio-anthropic
120 +```
121 +</Step>
122 +
123 +<Step title="Create session for user">
124 +Sessions are ephemeral, user-scoped and manage connections and tools for that user. See [Session Management](/docs/user-management) and [Configuring Toolkits](/tool-router/configuring-toolkits).
125 +
126 +<Info>
127 +Replace `your-api-key` with your Composio API key from the [developer dashboard](https://platform.composio.dev/?next_page=/settings). Replace `user_123` with the ID of the user in your system.
128 +</Info>
129 +```python
130 +from composio import Composio
131 +from composio_anthropic import AnthropicProvider
132 +
133 +composio = Composio(
134 + api_key="your-api-key",
135 + provider=AnthropicProvider()
136 +)
137 +session = composio.create(user_id="user_123")
138 +```
139 +</Step>
140 +
141 +<Step title="Run agent">
142 +When the agent needs authentication, it will prompt the user to connect. To pre-authenticate users, see [Manual Authentication](/tool-router/manual-authentication).
143 +```python
144 +from anthropic_agents import Agent, run
145 +
146 +agent = Agent(
147 + name="Assistant",
148 + instructions="You are a helpful assistant.",
149 + mcp_servers=[session.mcp.url]
150 +)
151 +
152 +result = run(
153 + agent,
154 + "Summarize all the emails in my Gmail inbox today"
155 +)
156 +print(result.final_output)
157 +```
158 +
159 +To use Anthropic Agents SDK with Tool Router as native tools instead, see [Using as Native Tools](/tool-router/using-as-native-tools#anthropic).
160 +</Step>
161 +</Steps>
162 +
163 +</Tab>
164 +
165 +<Tab title="Anthropic (TypeScript)">
166 +
167 +<Steps>
168 +<Step title="Install Composio SDK">
169 +```bash
170 +npm install @composio/core @composio/anthropic @anthropic-ai/agent
171 +```
172 +</Step>
173 +
174 +<Step title="Create session for user">
175 +Sessions are ephemeral, user-scoped and manage connections and tools for that user. See [Session Management](/docs/user-management) and [Configuring Toolkits](/tool-router/configuring-toolkits).
176 +
177 +<Info>
178 +Replace `your-api-key` with your Composio API key from the [developer dashboard](https://platform.composio.dev/?next_page=/settings). Replace `user_123` with the ID of the user in your system.
179 +</Info>
180 +```typescript
181 +import { Composio } from "@composio/core";
182 +import { AnthropicProvider } from "@composio/anthropic";
183 +
184 +const composio = new Composio({
185 + apiKey: "your-api-key",
186 + provider: new AnthropicProvider(),
187 +});
188 +const { mcp } = await composio.create("user_123");
189 +```
190 +</Step>
191 +
192 +<Step title="Run agent">
193 +When the agent needs authentication, it will prompt the user to connect. To pre-authenticate users, see [Manual Authentication](/tool-router/manual-authentication).
194 +```typescript
195 +import { Agent, run } from "@anthropic-ai/agent";
196 +
197 +const agent = new Agent({
198 + name: "Assistant",
199 + instructions: "You are a helpful assistant.",
200 + mcpServers: [mcp.url],
201 +});
202 +
203 +const result = await run(
204 + agent,
205 + "Summarize all the emails in my Gmail inbox today"
206 +);
207 +console.log(result.finalOutput);
208 +```
209 +
210 +To use Anthropic Agents SDK with Tool Router as native tools instead, see [Using as Native Tools](/tool-router/using-as-native-tools#anthropic).
211 +</Step>
212 +</Steps>
213 +
214 +</Tab>
215 +
216 +<Tab title="Vercel AI SDK">
217 +
218 +<Steps>
219 +<Step title="Install Composio SDK">
220 +```bash
221 +npm install @composio/core @composio/vercel ai @ai-sdk/openai
222 +```
223 +</Step>
224 +
225 +<Step title="Create session for user">
226 +Sessions are ephemeral, user-scoped and manage connections and tools for that user. See [Session Management](/docs/user-management) and [Configuring Toolkits](/tool-router/configuring-toolkits).
227 +
228 +<Info>
229 +Replace `your-api-key` with your Composio API key from the [developer dashboard](https://platform.composio.dev/?next_page=/settings). Replace `user_123` with the ID of the user in your system.
230 +</Info>
231 +```typescript
232 +import { Composio } from "@composio/core";
233 +import { VercelProvider } from "@composio/vercel";
234 +
235 +const composio = new Composio({
236 + apiKey: "your-api-key",
237 + provider: new VercelProvider(),
238 +});
239 +const { tools } = await composio.create("user_123");
240 +```
241 +</Step>
242 +
243 +<Step title="Run agent">
244 +When the agent needs authentication, it will prompt the user to connect. To pre-authenticate users, see [Manual Authentication](/tool-router/manual-authentication).
245 +```typescript
246 +import { generateText } from "ai";
247 +import { openai } from "@ai-sdk/openai";
248 +
249 +const result = await generateText({
250 + model: openai("gpt-4o"),
251 + tools: await tools(),
252 + prompt: "Summarize all the emails in my Gmail inbox today",
253 +});
254 +
255 +console.log(result.text);
256 +```
257 +
258 +To use Vercel AI SDK with Tool Router MCP instead, see [Using with MCP Clients](/tool-router/using-with-mcp-clients#vercel).
259 +</Step>
260 +</Steps>
261 +
262 +</Tab>
263 +</Tabs>
264 +
265 +## What just happened?
266 +
267 +When you ran this agent, Tool Router handled everything behind the scenes:
268 +
269 +1. **[Search](/tool-router/tool-search)** - Found the right Gmail tools from 1000+ available tools
270 +2. **[Authentication](/tool-router/authentication)** - Prompted you to connect your Gmail account
271 +3. **[Execution](/tool-router/tool-execution)** - Fetched your emails and processed results efficiently
272 +
273 +All you wrote was a prompt. Tool Router figured out the rest.
274 +
275 +## Next steps
276 +
277 +<CardGroup cols={3}>
278 + <Card title="Configure toolkits" href="/tool-router/configuring-toolkits">
279 + Enable or disable specific apps for your session.
280 + </Card>
281 + <Card title="Manual authentication" href="/tool-router/manual-authentication">
282 + Pre-authenticate users before running the agent.
283 + </Card>
284 + <Card title="Using MCP" href="/tool-router/using-with-mcp-clients">
285 + Connect Tool Router to any MCP-compatible client.
286 + </Card>
287 +</CardGroup>