@devries-cameron20 / composio-1 / commits / 57c9ccb14
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.

docs: Rewrite Vercel AI SDK provider page — Steps pattern, tested e2e

- Standardize to Steps pattern (Install → Configure → Run) matching other providers - Use IntegrationTabs for Tools vs MCP sections - Remove dotenv imports and verbose console.log for consistency - Add note about Vercel being TS-only and agentic (no manual loop) - Update Google model to gemini-3-pro-preview - Both Vercel examples (Tools + MCP) tested end-to-end Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 17, 2026 at 14:42 UTC 57c9ccb14ec03f2257bf93f131c22b0ebd6ee59d
2 files changed +66 -68
docs/content/docs/providers/google.mdx
+2 -2
@@ -56,7 +56,7 @@ session = composio.create(user_id="user_123")
56 tools = session.tools()
57
58 config = types.GenerateContentConfig(tools=tools)
59 -chat = client.chats.create(model="gemini-2.0-flash", config=config)
59 +chat = client.chats.create(model="gemini-3-pro-preview", config=config)
60 response = chat.send_message("Star the composiohq/composio repository on github")
61
62 # Agentic loop — keep executing tool calls until the model responds with text
@@ -87,7 +87,7 @@ const session = await composio.create("user_123");
87 const tools = await session.tools();
88
89 const chat = ai.chats.create({
90 - model: 'gemini-2.0-flash',
90 + model: 'gemini-3-pro-preview',
91 config: {
92 tools: [{ functionDeclarations: tools }],
93 },
docs/content/docs/providers/vercel.mdx
+64 -66
@@ -1,140 +1,138 @@
1 ---
2 title: Vercel AI SDK
3 description: Build an agent with Vercel AI SDK and enable it to use 800+ tools with Composio.
4 -keywords: [ai sdk]
4 +keywords: [ai sdk, vercel]
5 ---
6
7 -Vercel AI SDK allows you to configure an optional async `execute` function that the framework uses to execute the tool calls.
7 +The Vercel AI SDK provider transforms Composio tools into Vercel's [tool format](https://sdk.vercel.ai/docs/ai-sdk-core/tools-and-tool-calling) with built-in execution — no manual agentic loop needed.
8
9 -The Vercel provider for Composio formats the Composio tools and adds this `execute` function to the tool calls.
10 -
11 -## Usage with Tools
9 +<Callout type="info">
10 +Vercel AI SDK is TypeScript only. There is no Python SDK.
11 +</Callout>
12
13 -Use Composio as a native tool with the Vercel AI SDK.
13 +<IntegrationTabs tabs={[
14 + { value: "tools", label: "Tools" },
15 + { value: "mcp", label: "MCP" },
16 +]}>
17
15 -### Installation
18 +<IntegrationContent value="tools">
19 +<Steps>
20 +<Step>
21 +**Install**
22
23 ```bash
24 npm install @composio/core @composio/vercel ai @ai-sdk/anthropic
25 ```
26 +</Step>
27
21 -### Usage
22 -
23 -Create a session and use it as a native tool with Vercel AI SDK:
28 +<Step>
29 +**Configure API Keys**
30
31 <Callout type="info">
26 -- Set `COMPOSIO_API_KEY` environment variable with your API key from [Settings](https://platform.composio.dev/?next_page=/settings).
27 -- Set `ANTHROPIC_API_KEY` environment variable with your [Anthropic API key](https://console.anthropic.com/settings/keys).
32 +Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `ANTHROPIC_API_KEY` with your [Anthropic API key](https://console.anthropic.com/settings/keys).
33 </Callout>
34
35 +```txt title=".env"
36 +COMPOSIO_API_KEY=xxxxxxxxx
37 +ANTHROPIC_API_KEY=xxxxxxxxx
38 +```
39 +</Step>
40 +
41 +<Step>
42 +**Create session and run**
43 +
44 +The Vercel provider is **agentic** — tools include an `execute` function, so the AI SDK handles tool calls automatically via `maxSteps`.
45 +
46 ```typescript
47 // @noErrors
32 -import "dotenv/config";
48 import { anthropic } from "@ai-sdk/anthropic";
49 import { Composio } from "@composio/core";
50 import { VercelProvider } from "@composio/vercel";
36 -import { stepCountIs, streamText } from "ai";
51 +import { streamText, stepCountIs } from "ai";
52
38 -// Initialize Composio with Vercel provider (API key from env var COMPOSIO_API_KEY)
53 const composio = new Composio({ provider: new VercelProvider() });
54
41 -// Unique identifier of the user
42 -const userId = "user_123";
43 -
44 -// Create a session and get native tools for the user
45 -const session = await composio.create(userId);
55 +// Create a session for your user
56 +const session = await composio.create("user_123");
57 const tools = await session.tools();
58
48 -console.log("Fetching GitHub issues from the Composio repository...");
49 -
50 -// Stream the response with tool calling
59 const stream = await streamText({
52 - system: "You are a helpful personal assistant. Use Composio tools to take action.",
60 model: anthropic("claude-sonnet-4-5"),
54 - prompt: "Fetch all the open GitHub issues on the composio repository and group them by bugs/features/docs.",
55 - stopWhen: stepCountIs(10),
56 - onStepFinish: (step) => {
57 - for (const toolCall of step.toolCalls) {
58 - console.log(`[Using tool: ${toolCall.toolName}]`);
59 - }
60 - },
61 tools,
62 + prompt: "Star the composiohq/composio repository on github",
63 + stopWhen: stepCountIs(10),
64 });
65
66 for await (const textPart of stream.textStream) {
67 process.stdout.write(textPart);
68 }
67 -
68 -console.log("\n\n---");
69 -console.log("Tip: If prompted to authenticate, complete the auth flow and run again.");
69 ```
70 +</Step>
71 +</Steps>
72 +</IntegrationContent>
73
72 -## Usage with MCP
73 -
74 -Use Composio with the Vercel AI SDK for a fully managed MCP experience.
74 +<IntegrationContent value="mcp">
75 +<Steps>
76 +<Step>
77 +**Install**
78
76 -### Installation
79 +No `@composio/vercel` package needed — use Vercel AI SDK's [MCP client](https://sdk.vercel.ai/docs/ai-sdk-core/mcp) directly.
80
81 ```bash
79 -npm install dotenv @composio/core ai @ai-sdk/anthropic @ai-sdk/mcp
82 +npm install @composio/core ai @ai-sdk/anthropic @ai-sdk/mcp
83 ```
84 +</Step>
85
82 -### Usage
83 -
84 -Use Composio with Vercel AI SDK's `streamText` for completions:
86 +<Step>
87 +**Configure API Keys**
88
89 <Callout type="info">
87 -- Set `COMPOSIO_API_KEY` environment variable with your API key from [Settings](https://platform.composio.dev/?next_page=/settings).
88 -- Set `ANTHROPIC_API_KEY` environment variable with your [Anthropic API key](https://platform.claude.com/settings/keys).
90 +Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `ANTHROPIC_API_KEY` with your [Anthropic API key](https://console.anthropic.com/settings/keys).
91 </Callout>
92
93 +```txt title=".env"
94 +COMPOSIO_API_KEY=xxxxxxxxx
95 +ANTHROPIC_API_KEY=xxxxxxxxx
96 +```
97 +</Step>
98 +
99 +<Step>
100 +**Create session and run**
101 +
102 ```typescript
103 // @noErrors
93 -import "dotenv/config";
104 import { anthropic } from "@ai-sdk/anthropic";
105 import { experimental_createMCPClient as createMCPClient } from "@ai-sdk/mcp";
106 import { Composio } from "@composio/core";
97 -import { stepCountIs, streamText } from "ai";
107 +import { streamText, stepCountIs } from "ai";
108
99 -// Initialize Composio (API key from env var COMPOSIO_API_KEY or pass explicitly: { apiKey: "your-key" })
109 const composio = new Composio();
110
102 -// Unique identifier of the user
103 -const userId = "user_123";
111 +// Create a session for your user
112 +const { mcp } = await composio.create("user_123");
113
105 -// Create a session for the user
106 -const { mcp } = await composio.create(userId);
107 -
108 -// Create an MCP client to connect to the Composio MCP server
114 const client = await createMCPClient({
115 transport: {
116 type: "http",
117 url: mcp.url,
113 - headers: mcp.headers, // Authentication headers for the Composio MCP server
118 + headers: mcp.headers,
119 },
120 });
121 const tools = await client.tools();
122
118 -console.log("Summarizing your emails from today");
119 -
123 const stream = await streamText({
121 - system: "You are a helpful personal assistant. Use Composio tools to take action.",
124 model: anthropic("claude-sonnet-4-5"),
125 + tools,
126 prompt: "Summarize my emails from today",
127 stopWhen: stepCountIs(10),
125 - onStepFinish: (step) => {
126 - for (const toolCall of step.toolCalls) {
127 - console.log(`[Using tool: ${toolCall.toolName}]`);
128 - }
129 - },
130 - tools,
128 });
129
130 for await (const textPart of stream.textStream) {
131 process.stdout.write(textPart);
132 }
136 -
137 -console.log("\n\n---");
138 -console.log("Tip: If prompted to authenticate, complete the auth flow and run again.")
133 ```
134 +</Step>
135 +</Steps>
136 +</IntegrationContent>
137
138 +</IntegrationTabs>