@devries-cameron20 / composio Mirror · read-only / commits / d87d4d161
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, 09:30 UTC

docs: remove // @noErrors from all provider pages, fix type errors

Removed // @noErrors directive from vercel, langchain, google, llamaindex, and mastra provider pages. Fixed Mastra Agent config (added required id field). Reverted LangChain TS to StateGraph approach since langchain base package can't be installed in docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 17, 2026 at 16:11 UTC d87d4d16199178f8dab2efc44559225958ba5700
5 files changed +68 -68
docs/content/docs/providers/google.mdx
-1
@@ -72,7 +72,6 @@ print(response.text)
72 </Tab>
73 <Tab value="TypeScript">
74 ```typescript
75 -// @noErrors
75 import { Composio } from '@composio/core';
76 import { GoogleProvider } from '@composio/google';
77 import { GoogleGenAI, type Part } from '@google/genai';
docs/content/docs/providers/langchain.mdx
+36 -14
@@ -18,7 +18,7 @@ pip install composio composio_langchain langchain langchain_openai
18 </Tab>
19 <Tab value="TypeScript">
20 ```bash
21 -npm install @composio/core @composio/langchain langchain @langchain/openai
21 +npm install @composio/core @composio/langchain @langchain/openai @langchain/langgraph @langchain/core
22 ```
23 </Tab>
24 </Tabs>
@@ -63,9 +63,10 @@ print(result["messages"][-1].content)
63 </Tab>
64 <Tab value="TypeScript">
65 ```typescript
66 -// @noErrors
66 import { ChatOpenAI } from '@langchain/openai';
68 -import { createAgent } from 'langchain';
67 +import { HumanMessage, AIMessage } from '@langchain/core/messages';
68 +import { ToolNode } from '@langchain/langgraph/prebuilt';
69 +import { StateGraph, MessagesAnnotation } from '@langchain/langgraph';
70 import { Composio } from '@composio/core';
71 import { LangchainProvider } from '@composio/langchain';
72
@@ -77,18 +78,39 @@ const composio = new Composio({
78 const session = await composio.create("user_123");
79 const tools = await session.tools();
80
80 -const model = new ChatOpenAI({ model: 'gpt-5.2' });
81 -
82 -const agent = createAgent({
83 - model,
84 - tools,
85 -});
86 -
87 -const result = await agent.invoke({
88 - messages: [{ role: "user", content: "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'" }],
81 +const toolNode = new ToolNode(tools);
82 +
83 +const model = new ChatOpenAI({
84 + model: 'gpt-5.2',
85 + temperature: 0,
86 +}).bindTools(tools);
87 +
88 +function shouldContinue({ messages }: typeof MessagesAnnotation.State) {
89 + const lastMessage = messages[messages.length - 1] as AIMessage;
90 + if (lastMessage.tool_calls?.length) {
91 + return 'tools';
92 + }
93 + return '__end__';
94 +}
95 +
96 +async function callModel(state: typeof MessagesAnnotation.State) {
97 + const response = await model.invoke(state.messages);
98 + return { messages: [response] };
99 +}
100 +
101 +const workflow = new StateGraph(MessagesAnnotation)
102 + .addNode('agent', callModel)
103 + .addEdge('__start__', 'agent')
104 + .addNode('tools', toolNode)
105 + .addEdge('tools', 'agent')
106 + .addConditionalEdges('agent', shouldContinue);
107 +
108 +const app = workflow.compile();
109 +
110 +const finalState = await app.invoke({
111 + messages: [new HumanMessage("Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'")],
112 });
90 -
91 -console.log(result.messages[result.messages.length - 1].content);
113 +console.log(finalState.messages[finalState.messages.length - 1].content);
114 ```
115 </Tab>
116 </Tabs>
docs/content/docs/providers/llamaindex.mdx
-1
@@ -69,7 +69,6 @@ asyncio.run(main())
69 </Tab>
70 <Tab value="TypeScript">
71 ```typescript
72 -// @noErrors
72 import { Composio } from '@composio/core';
73 import { LlamaindexProvider } from '@composio/llamaindex';
74 import { openai } from '@llamaindex/openai';
docs/content/docs/providers/mastra.mdx
+32 -51
@@ -4,15 +4,36 @@ description: Build an agent with Mastra and enable it to use 800+ tools with Com
4 keywords: [mastra]
5 ---
6
7 -The Mastra provider formats Composio tools into a format compatible with [Mastra](https://mastra.ai/en/docs/tools-mcp/overview#creating-tools)'s tool calling capabilities, including input schemas, execution logic, and descriptions.
7 +The Mastra provider transforms Composio tools into [Mastra's tool format](https://mastra.ai/en/docs/tools-mcp/overview#creating-tools) with built-in execution.
8
9 -## Setup
9 +<Callout type="info">
10 +Mastra is TypeScript only. There is no Python SDK.
11 +</Callout>
12 +
13 +<Steps>
14 +<Step>
15 +**Install**
16
17 ```bash
18 npm install @composio/core @composio/mastra @mastra/core @ai-sdk/openai
19 ```
20 +</Step>
21 +
22 +<Step>
23 +**Configure API Keys**
24
15 -## Usage
25 +<Callout type="info">
26 +Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/api-keys).
27 +</Callout>
28 +
29 +```txt title=".env"
30 +COMPOSIO_API_KEY=xxxxxxxxx
31 +OPENAI_API_KEY=xxxxxxxxx
32 +```
33 +</Step>
34 +
35 +<Step>
36 +**Create session and run**
37
38 ```typescript
39 import { Composio } from "@composio/core";
@@ -29,58 +50,18 @@ const session = await composio.create("user_123");
50 const tools = await session.tools();
51
52 const agent = new Agent({
32 - id: "github-agent",
33 - name: "GitHub Agent",
34 - instructions: "You are a helpful assistant that can perform GitHub actions.",
35 - model: openai("gpt-4.1"),
36 - tools: tools,
53 + id: "my-agent",
54 + name: "My Agent",
55 + instructions: "You are a helpful assistant.",
56 + model: openai("gpt-5.2"),
57 + tools,
58 });
59
60 const { text } = await agent.generate([
40 - { role: "user", content: "Star the composiohq/composio repository on GitHub" },
61 + { role: "user", content: "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'" },
62 ]);
63
64 console.log(text);
65 ```
45 -
46 -## Usage with MCP
47 -
48 -You can also use Composio MCP servers directly with Mastra's MCPClient.
49 -
50 -<Callout type="info">
51 -Composio MCP servers only support Streamable HTTP transport.
52 -</Callout>
53 -
54 -```typescript
55 -// @noErrors
56 -import { MCPClient } from "@mastra/mcp";
57 -import { openai } from "@ai-sdk/openai";
58 -import { Agent } from "@mastra/core/agent";
59 -import { Composio } from "@composio/core";
60 -
61 -const composio = new Composio();
62 -
63 -// Create a session for your user
64 -const session = await composio.create("user_123");
65 -
66 -// Create MCP client with the session's MCP server
67 -const mcpClient = new MCPClient({
68 - id: "composio-mcp-client",
69 - servers: {
70 - composio: { url: new URL(session.mcp.url) },
71 - }
72 -});
73 -
74 -const agent = new Agent({
75 - id: "dev-assistant",
76 - name: "Dev Assistant",
77 - instructions: "Help manage GitHub repos, Linear issues, and Notion documentation.",
78 - model: openai("gpt-4-turbo"),
79 - tools: await mcpClient.getTools()
80 -});
81 -
82 -const response = await agent.generate(
83 - "Star the composiohq/composio repository on GitHub"
84 -);
85 -console.log(response.text);
86 -```
66 +</Step>
67 +</Steps>
docs/content/docs/providers/vercel.mdx
-1
@@ -38,7 +38,6 @@ ANTHROPIC_API_KEY=xxxxxxxxx
38 The Vercel provider is **agentic** — tools include an `execute` function, so the AI SDK handles tool calls automatically via [`stopWhen`](https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling).
39
40 ```typescript
41 -// @noErrors
41 import { anthropic } from "@ai-sdk/anthropic";
42 import { Composio } from "@composio/core";
43 import { VercelProvider } from "@composio/vercel";