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: add examples for all 3 custom tool flows in changelog
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dhawal Upadhyay committed
Mar 18, 2026 at 14:53 UTC
4bda9044758d3bf77678043724911cbc2c80b494
1 file changed
+51
-15
ts/packages/core/CHANGELOG.md
+51
-15
@@ -6,33 +6,69 @@
6
7
- feat(core): custom tools, custom toolkits, and proxy execute for tool router sessions (TypeScript only)
8
9
- ### Custom Tools
9
+ #### Standalone tool (no auth)
10
11
- Define local tools that execute in-process alongside remote Composio tools:
12
- - **Standalone tools** — no auth, run entirely locally
13
- - **Extension tools** — inherit auth from a Composio toolkit (e.g. Gmail) via `extendsToolkit`
14
- - **Custom toolkits** — group related tools under a namespace
11
+ ```typescript
12
+ import { experimental_createTool } from "@composio/core";
13
+
14
+ const getUser = experimental_createTool("GET_USER", {
15
+ name: "Get user",
16
+ description: "Look up user by ID",
17
+ inputParams: z.object({ user_id: z.string() }),
18
+ execute: async ({ user_id }) => {
19
+ return { name: "Alice", email: "alice@acme.com" };
20
+ },
21
+ });
22
+ ```
23
+
24
+ #### Extension tool (inherits auth from a Composio toolkit)
25
+
26
+ ```typescript
27
+ const createDraft = experimental_createTool("CREATE_DRAFT", {
28
+ extendsToolkit: "gmail",
29
+ name: "Create Gmail draft",
30
+ description: "Create a draft via Gmail API",
31
+ inputParams: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
32
+ execute: async (input, ctx) => {
33
+ const res = await ctx.proxyExecute({
34
+ toolkit: "gmail",
35
+ endpoint: "https://gmail.googleapis.com/gmail/v1/users/me/drafts",
36
+ method: "POST",
37
+ body: { message: { raw: buildRawEmail(input) } },
38
+ });
39
+ return { draft_id: res.data.id, status: res.status };
40
+ },
41
+ });
42
+ ```
43
16
- ### Proxy Execute
44
+ #### Custom toolkit (groups tools under a namespace)
45
18
- `session.proxyExecute()` and `ctx.proxyExecute()` for raw HTTP API calls through Composio's auth layer. Returns `{ status, data, headers }`.
46
+ ```typescript
47
+ import { experimental_createToolkit } from "@composio/core";
48
+
49
+ const userMgmt = experimental_createToolkit("USER_MANAGEMENT", {
50
+ name: "User Management",
51
+ description: "Manage user roles and status",
52
+ tools: [setRoleTool, updateStatusTool],
53
+ });
54
+ ```
55
20
- ### Session Creation
56
+ #### Session creation
57
58
```typescript
23
- const session = await composio.create('user_123', {
24
- toolkits: ['gmail'],
59
+ const session = await composio.create("user_123", {
60
+ toolkits: ["gmail"],
61
experimental: {
26
- customTools: [myTool, myExtensionTool],
27
- customToolkits: [myToolkit],
62
+ customTools: [getUser, createDraft],
63
+ customToolkits: [userMgmt],
64
},
65
});
66
```
67
32
- ### Other Changes
33
- - Slug mapping uses backend response (`slug`/`original_slug`) instead of client-side prefix
68
+ #### Other changes
69
+ - `session.proxyExecute()` / `ctx.proxyExecute()` for raw HTTP calls through Composio auth — returns `{ status, data, headers }`
70
+ - Slug mapping uses backend response instead of client-side `LOCAL_` prefix
71
- Uses official `@composio/client@0.1.0-alpha.62` types
35
- - `proxyExecute` uses official client method
72
73
## 0.6.5
74