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

fix: resolve TypeScript build errors in Vercel AI and Mastra examples

- Update Vercel AI examples: CoreMessage → ModelMessage, maxSteps → stopWhen - Fix message content format to use structured content array - Add required instructions property to Mastra Agent - Add required parameters to mcp.list() calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Sushmithamallesh committed Jan 25, 2026 at 23:29 UTC 0b057dc0a6459cfa957e17a5c98ee7a8e8131cce
2 files changed +23 -12
docs/content/docs/quickstart.mdx
+10 -10
@@ -692,7 +692,7 @@ import "dotenv/config";
692 import { anthropic } from "@ai-sdk/anthropic";
693 import { Composio } from "@composio/core";
694 import { VercelProvider } from "@composio/vercel";
695 -import { CoreMessage, stepCountIs, streamText } from "ai";
695 +import { streamText, stepCountIs, type ModelMessage } from "ai";
696 import { createInterface } from "readline/promises";
697
698 // Initialize Composio with Vercel provider
@@ -715,13 +715,13 @@ Example tasks:
715 `);
716
717 // Message history for multi-turn conversation
718 -const messages: CoreMessage[] = [];
718 +const messages: ModelMessage[] = [];
719
720 while (true) {
721 const input = (await readline.question("You: ")).trim();
722 if (input.toLowerCase() === "exit") break;
723
724 - messages.push({ role: "user", content: input });
724 + messages.push({ role: "user", content: [{ type: "text", text: input }] });
725 process.stdout.write("Assistant: ");
726
727 try {
@@ -729,7 +729,7 @@ while (true) {
729 system: "You are a helpful personal assistant. Use Composio tools to take action.",
730 model: anthropic("claude-sonnet-4-5"),
731 messages,
732 - maxSteps: 10,
732 + stopWhen: stepCountIs(10),
733 onStepFinish: (step) => {
734 for (const toolCall of step.toolCalls) {
735 process.stdout.write(`\n[Using tool: ${toolCall.toolName}]`);
@@ -746,7 +746,7 @@ while (true) {
746 console.log();
747
748 // Add assistant response to history for context
749 - messages.push({ role: "assistant", content: assistantResponse });
749 + messages.push({ role: "assistant", content: [{ type: "text", text: assistantResponse }] });
750 } catch (error) {
751 console.error("\n[Error]:", error instanceof Error ? error.message : error);
752 }
@@ -790,7 +790,7 @@ import "dotenv/config";
790 import { anthropic } from "@ai-sdk/anthropic";
791 import { experimental_createMCPClient as createMCPClient } from "@ai-sdk/mcp";
792 import { Composio } from "@composio/core";
793 -import { CoreMessage, stepCountIs, streamText } from "ai";
793 +import { streamText, stepCountIs, type ModelMessage } from "ai";
794 import { createInterface } from "readline/promises";
795
796 // Initialize Composio
@@ -822,13 +822,13 @@ Example tasks:
822 `);
823
824 // Message history for multi-turn conversation
825 -const messages: CoreMessage[] = [];
825 +const messages: ModelMessage[] = [];
826
827 while (true) {
828 const input = (await readline.question("You: ")).trim();
829 if (input.toLowerCase() === "exit") break;
830
831 - messages.push({ role: "user", content: input });
831 + messages.push({ role: "user", content: [{ type: "text", text: input }] });
832 process.stdout.write("Assistant: ");
833
834 try {
@@ -836,7 +836,7 @@ while (true) {
836 system: "You are a helpful personal assistant. Use Composio tools to take action.",
837 model: anthropic("claude-sonnet-4-5"),
838 messages,
839 - maxSteps: 10,
839 + stopWhen: stepCountIs(10),
840 onStepFinish: (step) => {
841 for (const toolCall of step.toolCalls) {
842 process.stdout.write(`\n[Using tool: ${toolCall.toolName}]`);
@@ -853,7 +853,7 @@ while (true) {
853 console.log();
854
855 // Add assistant response to history for context
856 - messages.push({ role: "assistant", content: assistantResponse });
856 + messages.push({ role: "assistant", content: [{ type: "text", text: assistantResponse }] });
857 } catch (error) {
858 console.error("\n[Error]:", error instanceof Error ? error.message : error);
859 }
docs/content/docs/single-toolkit-mcp.mdx
+13 -2
@@ -192,6 +192,7 @@ const client = new MCPClient({
192 const agent = new Agent({
193 id: "assistant",
194 name: "Assistant",
195 + instructions: "You are a helpful assistant that can read and manage emails.",
196 model: openai("gpt-4-turbo"),
197 tools: await client.getTools()
198 });
@@ -223,11 +224,21 @@ gmail_servers = composio.mcp.list(toolkits="gmail", limit=20)
224 import { Composio } from '@composio/core';
225 const composio = new Composio({ apiKey: 'your_api_key' });
226 // ---cut---
226 -const servers = await composio.mcp.list({ limit: 10, page: 1 });
227 +const servers = await composio.mcp.list({
228 + toolkits: [],
229 + authConfigs: [],
230 + limit: 10,
231 + page: 1
232 +});
233 console.log(`Found ${servers.items.length} servers`);
234
235 // Filter by toolkit
230 -const gmailServers = await composio.mcp.list({ toolkits: ["gmail"] });
236 +const gmailServers = await composio.mcp.list({
237 + toolkits: ["gmail"],
238 + authConfigs: [],
239 + limit: 20,
240 + page: 1
241 +});
242 ```
243 </Tab>
244 </Tabs>