@devries-cameron20 / composio-1 / commits / 1c20c29e3
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: shorten tool naming, verification, and execution sections

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Dhawal Upadhyay committed Mar 23, 2026 at 18:14 UTC 1c20c29e39877b4d2bfdfa2168bc5161aa4e7b14
1 file changed +4 -48
docs/content/docs/toolkits/custom-tools-and-toolkits.mdx
+4 -48
@@ -116,61 +116,17 @@ Custom tools integrate seamlessly with Composio's meta tools:
116
117 ## Tool naming
118
119 -Tool names exposed to the agent are automatically prefixed with `LOCAL_` and the toolkit name (if any):
119 +Tool names exposed to the agent are automatically prefixed with `LOCAL_` and the toolkit name (if any). For example, `GET_USER_PROFILE` becomes `LOCAL_GET_USER_PROFILE`, and `ASSIGN_ROLE` inside `USER_MANAGEMENT` becomes `LOCAL_USER_MANAGEMENT_ASSIGN_ROLE`.
120
121 -- `GET_USER_PROFILE` → `LOCAL_GET_USER_PROFILE`
122 -- `SEND_PROMO_EMAIL` → `LOCAL_SEND_PROMO_EMAIL`
123 -- `ASSIGN_ROLE` in `USER_MANAGEMENT` toolkit → `LOCAL_USER_MANAGEMENT_ASSIGN_ROLE`
124 -
125 -Slugs cannot start with `LOCAL_` or `COMPOSIO_` — these prefixes are reserved.
121 +Registered slugs cannot start with `LOCAL_` or `COMPOSIO_` — these prefixes are reserved.
122
123 ## Verifying registration
124
129 -After creating a session, use `session.customTools()` and `session.customToolkits()` to verify your tools were registered correctly:
130 -
131 -```typescript
132 -import { Composio, experimental_createTool, experimental_createToolkit } from "@composio/core";
133 -import { z } from "zod/v3";
134 -
135 -const getUserProfile = experimental_createTool("GET_USER_PROFILE", { name: "Get user profile", description: "Retrieve profile", inputParams: z.object({}), execute: async (_input, ctx) => ({}) });
136 -const userManagement = experimental_createToolkit("USER_MANAGEMENT", { name: "User management", description: "Manage roles", tools: [experimental_createTool("ASSIGN_ROLE", { name: "Assign role", description: "Assign role", inputParams: z.object({ user_id: z.string() }), execute: async () => ({}) })] });
137 -const composio = new Composio({ apiKey: "your_api_key" });
138 -const session = await composio.create("user_1", { experimental: { customTools: [getUserProfile], customToolkits: [userManagement] } });
139 -// ---cut---
140 -// List all registered custom tools (with their final LOCAL_ prefixed slugs)
141 -const registeredTools = session.customTools();
142 -console.log(registeredTools);
143 -// [{ slug: "LOCAL_GET_USER_PROFILE", name: "Get user profile", ... }]
144 -
145 -// Filter by toolkit
146 -const managementTools = session.customTools({ toolkit: "USER_MANAGEMENT" });
147 -
148 -// List registered custom toolkits
149 -const registeredToolkits = session.customToolkits();
150 -console.log(registeredToolkits);
151 -// [{ slug: "USER_MANAGEMENT", name: "User management", tools: [...] }]
152 -```
125 +Use `session.customTools()` to list registered tools (with their final `LOCAL_` prefixed slugs), or filter by toolkit with `session.customTools({ toolkit: "USER_MANAGEMENT" })`. Use `session.customToolkits()` to list registered toolkits.
126
127 ## Programmatic execution
128
156 -Use `session.execute()` to run custom tools directly — outside of an agent loop. You can use the original slug without the `LOCAL_` prefix:
157 -
158 -```typescript
159 -import { Composio, experimental_createTool } from "@composio/core";
160 -import { z } from "zod/v3";
161 -
162 -const getUserProfile = experimental_createTool("GET_USER_PROFILE", { name: "Get user profile", description: "Retrieve profile", inputParams: z.object({}), execute: async (_input, ctx) => ({ name: "Alice", tier: "enterprise" }) });
163 -const composio = new Composio({ apiKey: "your_api_key" });
164 -const session = await composio.create("user_1", { experimental: { customTools: [getUserProfile] } });
165 -// ---cut---
166 -// Both work — original slug or full LOCAL_ prefixed slug
167 -const result = await session.execute("GET_USER_PROFILE");
168 -const same = await session.execute("LOCAL_GET_USER_PROFILE");
169 -
170 -console.log(result.data); // { name: "Alice", tier: "enterprise" }
171 -```
172 -
173 -Custom tools execute in-process. Remote Composio tools are sent to the backend automatically.
129 +Use `session.execute()` to run custom tools directly, outside of an agent loop. Accepts the original slug — no `LOCAL_` prefix needed (e.g. `session.execute("GET_USER_PROFILE")`). Custom tools execute in-process; remote tools are sent to the backend automatically.
130
131 ## SessionContext
132