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.

fix: transform customAuthParams.baseURL to base_url in tool execution

jkomyno11e64395d239
diff --git a/ts/packages/core/src/models/Tools.ts b/ts/packages/core/src/models/Tools.ts
index 19b5aa2fb..909a2793a 100644
--- a/ts/packages/core/src/models/Tools.ts
+++ b/ts/packages/core/src/models/Tools.ts
@@ -786,7 +786,13 @@ export class Tools<
const result = await this.client.tools.execute(tool.slug, {
allow_tracing: body.allowTracing,
connected_account_id: body.connectedAccountId,
- custom_auth_params: body.customAuthParams,
+ custom_auth_params: body.customAuthParams
+ ? {
+ base_url: body.customAuthParams.baseURL,
+ body: body.customAuthParams.body,
+ parameters: body.customAuthParams.parameters,
+ }
+ : undefined,
/**
* @deprecated: customConnectionData
* @description
diff --git a/ts/packages/core/test/tools/tools.test.ts b/ts/packages/core/test/tools/tools.test.ts
index e634d6a69..3d3ad4bcd 100644
--- a/ts/packages/core/test/tools/tools.test.ts
+++ b/ts/packages/core/test/tools/tools.test.ts
@@ -650,6 +650,41 @@ describe('Tools', () => {
expect(result).toEqual(toolMocks.toolExecuteResponse);
});
+ it('should transform customAuthParams.baseURL to base_url when executing a tool', async () => {
+ const slug = 'COMPOSIO_TOOL';
+ const body = {
+ userId: 'test-user',
+ connectedAccountId: 'test-connected-account-id',
+ arguments: { query: 'test' },
+ dangerouslySkipVersionCheck: true,
+ customAuthParams: {
+ baseURL: 'https://custom-api.example.com',
+ parameters: [{ name: 'x-api-key', value: 'test-key', in: 'header' as const }],
+ body: { extra: 'data' },
+ },
+ };
+
+ await mockToolExecution(context.tools);
+
+ const result = await context.tools.execute(slug, body);
+
+ expect(mockClient.tools.execute).toHaveBeenCalledWith(slug, {
+ allow_tracing: undefined,
+ connected_account_id: 'test-connected-account-id',
+ custom_auth_params: {
+ base_url: 'https://custom-api.example.com',
+ parameters: [{ name: 'x-api-key', value: 'test-key', in: 'header' }],
+ body: { extra: 'data' },
+ },
+ custom_connection_data: undefined,
+ arguments: body.arguments,
+ user_id: body.userId,
+ version: 'latest',
+ text: undefined,
+ });
+ expect(result).toEqual(toolMocks.toolExecuteResponse);
+ });
+
it('should pass version parameter from execute() to getRawComposioToolBySlug()', async () => {
const slug = 'COMPOSIO_TOOL';
const explicitVersion = '20250909_00';