Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 15:45 UTC
Fix method binding in tool router (#2328)
Musthaq Ahamad committed
Jan 5, 2026 at 18:29 UTC
019f54f157dd694e8d6d0b6f0ba8b2ef0ffa15e6
2 files changed
+8
-4
.changeset/dark-zoos-own.md
new
+5
@@ -0,0 +1,5 @@
1
+---
2
+'@composio/core': patch
3
+---
4
+
5
+Fix method binding for top level tool router methods
ts/packages/core/src/composio.ts
+3
-4
@@ -272,14 +272,13 @@ export class Composio<
272
this.files = new Files(this.client);
273
this.connectedAccounts = new ConnectedAccounts(this.client);
274
this.toolRouter = new ToolRouter(this.client, this.config);
275
- this.toolRouter.create.bind(this.toolRouter);
276
- this.toolRouter.use.bind(this.toolRouter);
275
276
/**
277
* Initialize tool router methods
278
+ * Properly bind the methods to maintain the correct 'this' context
279
*/
281
- this.create = this.toolRouter.create;
282
- this.use = this.toolRouter.use;
280
+ this.create = this.toolRouter.create.bind(this.toolRouter);
281
+ this.use = this.toolRouter.use.bind(this.toolRouter);
282
283
/**
284
* Initialize Experimental features