@devries-cameron20 / composio-1 / commits / e1621541f
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.

Add connectedAccount checks when executing a tool

haxzie committed May 14, 2025 at 17:59 UTC e1621541f50727cef2ca654c7b8c0e11c4613751
1 file changed +3 -4
packages/core/src/models/Tools.ts
+3 -4
@@ -27,6 +27,7 @@ import {
27 TransformToolSchemaModifier,
28 } from '../types/modifiers.types';
29 import { BaseComposioToolset } from '../toolset/BaseToolset';
30 +import logger from '../utils/logger';
31
32 /**
33 * This class is used to manage tools in the Composio SDK.
@@ -124,9 +125,7 @@ export class Tools<
125 // check if each tool's toolkit has a connected account
126 for (const tool of Object.keys(toolSlugs)) {
127 if (!connectedToolkitSlugs[tool]) {
127 - console.warn(
128 - `Tool ${tool} requires a connected account but no connected account was found`
129 - );
128 + logger.warn(`Tool ${tool} requires a connected account but no connected account was found`);
129 return false;
130 }
131 }
@@ -169,7 +168,7 @@ export class Tools<
168 }
169 // by default, use the first connected account
170 // @TODO: Add support for multiple connected accounts
172 - console.warn(
171 + logger.warn(
172 `Using the first connected account for tool ${toolSlug}. To change this behaviour please explicitly pass a connectedAccountId for the tool`
173 );
174 return connectedAccounts.items[0].id;