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: tighten code comments, remove empty lines between comments and code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dhawal Upadhyay committed
Mar 23, 2026 at 14:13 UTC
13a675ff1edd070026333a2a608577cf7481ced5
1 file changed
+4
-10
docs/content/docs/toolkits/custom-tools-and-toolkits.mdx
+4
-10
@@ -28,7 +28,6 @@ import { z } from "zod/v3";
28
// ── Standalone tool ─────────────────────────────────────────────
29
// Internal data lookup — no Composio auth needed.
30
// ctx.userId identifies which user's session is running.
31
-
31
const profiles: Record<string, { name: string; email: string; tier: string }> = {
32
"user_1": { name: "Alice Johnson", email: "alice@myapp.com", tier: "enterprise" },
33
"user_2": { name: "Bob Smith", email: "bob@myapp.com", tier: "free" },
@@ -46,10 +45,8 @@ const getUserProfile = experimental_createTool("GET_USER_PROFILE", {
45
});
46
47
// ── Extension tool ──────────────────────────────────────────────
49
-// Wraps Gmail API with business logic. Inherits Gmail auth from the session
50
-// via extendsToolkit, so ctx.proxyExecute() handles credentials automatically.
51
-// This constrains the agent to send only the approved promo template.
52
-
48
+// Wraps Gmail API with business logic. Inherits auth via extendsToolkit,
49
+// so ctx.proxyExecute() handles credentials automatically.
50
const sendPromoEmail = experimental_createTool("SEND_PROMO_EMAIL", {
51
name: "Send promo email",
52
description: "Send the standard promotional email to a recipient",
@@ -73,10 +70,8 @@ const sendPromoEmail = experimental_createTool("SEND_PROMO_EMAIL", {
70
});
71
72
// ── Custom toolkit ──────────────────────────────────────────────
76
-// Groups related tools under a namespace.
77
-// Tools inside a toolkit must NOT use extendsToolkit — they inherit
78
-// the toolkit identity instead.
79
-
73
+// Groups standalone tools that don't need Composio auth under a toolkit.
74
+// Tools inside a toolkit cannot use extendsToolkit.
75
const userManagement = experimental_createToolkit("USER_MANAGEMENT", {
76
name: "User management",
77
description: "Manage user roles and permissions",
@@ -96,7 +91,6 @@ const userManagement = experimental_createToolkit("USER_MANAGEMENT", {
91
// ── Bind to session ─────────────────────────────────────────────
92
// Pass custom tools and toolkits via the experimental option.
93
// session.tools() returns both remote Composio tools and your custom tools.
99
-
94
const composio = new Composio({ apiKey: "your_api_key" });
95
96
const session = await composio.create("user_1", {