Skip to content

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

Add workdlows

haxzie5ad91aecd2ab
diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml
new file mode 100644
index 000000000..e69de29bb
diff --git a/examples/connected-accounts/src/magic-flow-demo.ts b/examples/connected-accounts/src/magic-flow-demo.ts
new file mode 100644
index 000000000..88945e9e6
--- /dev/null
+++ b/examples/connected-accounts/src/magic-flow-demo.ts
@@ -0,0 +1,47 @@
+import { Composio } from '@composio/core';
+import { OpenAI } from 'openai';
+
+const userId = 'default';
+
+const composio = new Composio({
+ apiKey: process.env.COMPOSIO_API_KEY,
+});
+
+const openai = new OpenAI({
+ apiKey: process.env.OPENAI_API_KEY,
+});
+
+// ------------------------------------------------------------
+// 1. Authorize the user to GitHub
+// ------------------------------------------------------------
+
+const connectionRequest = await composio.toolkits.authorize(userId, 'github');
+// Redirect the user to continue to auth flow
+const redirectUrl = connectionRequest.redirectUrl;
+
+// Wait for the user to connect the account / singin to GitHub
+const connectedAccount = await connectionRequest.waitForConnection();
+
+// ------------------------------------------------------------
+// 2. Get the GitHub tools
+// ------------------------------------------------------------
+
+const tools = await composio.tools.get(userId, {
+ toolkits: ['github'],
+});
+
+// ------------------------------------------------------------
+// 3. Use the Composio GitHub tools with OpenAI
+// ------------------------------------------------------------
+const task = 'Star the composio repository on GitHub';
+const messages: OpenAI.ChatCompletionMessageParam[] = [
+ { role: 'system', content: 'You are a helpful assistant that can help with tasks.' },
+ { role: 'user', content: task },
+];
+
+const response = await openai.chat.completions.create({
+ model: 'gpt-4o-mini',
+ messages,
+ tools: tools,
+ tool_choice: 'auto',
+});
diff --git a/examples/toolkits/src/index.ts b/examples/toolkits/src/index.ts
index f83c33c13..83982d541 100644
--- a/examples/toolkits/src/index.ts
+++ b/examples/toolkits/src/index.ts
@@ -5,10 +5,4 @@ const composio = new Composio({
});
const toolkit = await composio.toolkits.get('hackernews');
-
-const connectedAccount = await composio.connectedAccounts.list({
- user_id: 'default',
- toolkit_slug: 'hackernews',
-});
-
-console.log(JSON.stringify(connectedAccount, null, 2));
+const client = composio.getClient();
diff --git a/packages/core/src/models/Tools.ts b/packages/core/src/models/Tools.ts
index beba52bd6..526ba1152 100644
--- a/packages/core/src/models/Tools.ts
+++ b/packages/core/src/models/Tools.ts
@@ -200,7 +200,7 @@ export class Tools<
/**
* Lists all tools available in the Composio SDK as well as custom tools.
- * This method fetches the tools from the Composio API and wraps them using the provider.
+ * This method fetches the tools from the Composio API in the raw format.
* @returns {ToolList} List of tools
*/
async getRawComposioTools(
@@ -257,6 +257,7 @@ export class Tools<
/**
* Retrieves a tool by its Slug.
+ * This method is used to get the raw tools from the composio API.
* @param slug The ID of the tool to be retrieved
* @returns {Promise<Tool>} The tool
*