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.

docs: add examples for all 3 custom tool flows in changelog

Dhawal Upadhyay4bda9044758d
diff --git a/ts/packages/core/CHANGELOG.md b/ts/packages/core/CHANGELOG.md
index 2d8770267..3b10c15ae 100644
--- a/ts/packages/core/CHANGELOG.md
+++ b/ts/packages/core/CHANGELOG.md
@@ -6,33 +6,69 @@
- feat(core): custom tools, custom toolkits, and proxy execute for tool router sessions (TypeScript only)
- ### Custom Tools
+ #### Standalone tool (no auth)
- Define local tools that execute in-process alongside remote Composio tools:
- - **Standalone tools** — no auth, run entirely locally
- - **Extension tools** — inherit auth from a Composio toolkit (e.g. Gmail) via `extendsToolkit`
- - **Custom toolkits** — group related tools under a namespace
+ ```typescript
+ import { experimental_createTool } from "@composio/core";
+
+ const getUser = experimental_createTool("GET_USER", {
+ name: "Get user",
+ description: "Look up user by ID",
+ inputParams: z.object({ user_id: z.string() }),
+ execute: async ({ user_id }) => {
+ return { name: "Alice", email: "[email protected]" };
+ },
+ });
+ ```
+
+ #### Extension tool (inherits auth from a Composio toolkit)
+
+ ```typescript
+ const createDraft = experimental_createTool("CREATE_DRAFT", {
+ extendsToolkit: "gmail",
+ name: "Create Gmail draft",
+ description: "Create a draft via Gmail API",
+ inputParams: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
+ execute: async (input, ctx) => {
+ const res = await ctx.proxyExecute({
+ toolkit: "gmail",
+ endpoint: "https://gmail.googleapis.com/gmail/v1/users/me/drafts",
+ method: "POST",
+ body: { message: { raw: buildRawEmail(input) } },
+ });
+ return { draft_id: res.data.id, status: res.status };
+ },
+ });
+ ```
- ### Proxy Execute
+ #### Custom toolkit (groups tools under a namespace)
- `session.proxyExecute()` and `ctx.proxyExecute()` for raw HTTP API calls through Composio's auth layer. Returns `{ status, data, headers }`.
+ ```typescript
+ import { experimental_createToolkit } from "@composio/core";
+
+ const userMgmt = experimental_createToolkit("USER_MANAGEMENT", {
+ name: "User Management",
+ description: "Manage user roles and status",
+ tools: [setRoleTool, updateStatusTool],
+ });
+ ```
- ### Session Creation
+ #### Session creation
```typescript
- const session = await composio.create('user_123', {
- toolkits: ['gmail'],
+ const session = await composio.create("user_123", {
+ toolkits: ["gmail"],
experimental: {
- customTools: [myTool, myExtensionTool],
- customToolkits: [myToolkit],
+ customTools: [getUser, createDraft],
+ customToolkits: [userMgmt],
},
});
```
- ### Other Changes
- - Slug mapping uses backend response (`slug`/`original_slug`) instead of client-side prefix
+ #### Other changes
+ - `session.proxyExecute()` / `ctx.proxyExecute()` for raw HTTP calls through Composio auth — returns `{ status, data, headers }`
+ - Slug mapping uses backend response instead of client-side `LOCAL_` prefix
- Uses official `@composio/[email protected]` types
- - `proxyExecute` uses official client method
## 0.6.5