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
The SDK's CustomAuthParams uses `baseURL` (camelCase) but the API expects `base_url` (snake_case). Previously, customAuthParams was passed directly to the client without property name transformation, causing `baseURL` to be silently dropped by the API. Resolves PLEN-1942
jkomyno committed
Apr 1, 2026 at 15:53 UTC
11e64395d2395048c8f4da219ebe5cad996dc6e3
2 files changed
+42
-1
ts/packages/core/src/models/Tools.ts
+7
-1
@@ -786,7 +786,13 @@ export class Tools<
786
const result = await this.client.tools.execute(tool.slug, {
787
allow_tracing: body.allowTracing,
788
connected_account_id: body.connectedAccountId,
789
- custom_auth_params: body.customAuthParams,
789
+ custom_auth_params: body.customAuthParams
790
+ ? {
791
+ base_url: body.customAuthParams.baseURL,
792
+ body: body.customAuthParams.body,
793
+ parameters: body.customAuthParams.parameters,
794
+ }
795
+ : undefined,
796
/**
797
* @deprecated: customConnectionData
798
* @description
ts/packages/core/test/tools/tools.test.ts
+35
@@ -650,6 +650,41 @@ describe('Tools', () => {
650
expect(result).toEqual(toolMocks.toolExecuteResponse);
651
});
652
653
+ it('should transform customAuthParams.baseURL to base_url when executing a tool', async () => {
654
+ const slug = 'COMPOSIO_TOOL';
655
+ const body = {
656
+ userId: 'test-user',
657
+ connectedAccountId: 'test-connected-account-id',
658
+ arguments: { query: 'test' },
659
+ dangerouslySkipVersionCheck: true,
660
+ customAuthParams: {
661
+ baseURL: 'https://custom-api.example.com',
662
+ parameters: [{ name: 'x-api-key', value: 'test-key', in: 'header' as const }],
663
+ body: { extra: 'data' },
664
+ },
665
+ };
666
+
667
+ await mockToolExecution(context.tools);
668
+
669
+ const result = await context.tools.execute(slug, body);
670
+
671
+ expect(mockClient.tools.execute).toHaveBeenCalledWith(slug, {
672
+ allow_tracing: undefined,
673
+ connected_account_id: 'test-connected-account-id',
674
+ custom_auth_params: {
675
+ base_url: 'https://custom-api.example.com',
676
+ parameters: [{ name: 'x-api-key', value: 'test-key', in: 'header' }],
677
+ body: { extra: 'data' },
678
+ },
679
+ custom_connection_data: undefined,
680
+ arguments: body.arguments,
681
+ user_id: body.userId,
682
+ version: 'latest',
683
+ text: undefined,
684
+ });
685
+ expect(result).toEqual(toolMocks.toolExecuteResponse);
686
+ });
687
+
688
it('should pass version parameter from execute() to getRawComposioToolBySlug()', async () => {
689
const slug = 'COMPOSIO_TOOL';
690
const explicitVersion = '20250909_00';