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, 22:00 UTC
feat: support custom connection data arg in execute proxy and tool (#1766)
lingalarahul7 committed
Jul 21, 2025 at 17:14 UTC
cea1b4881da3fca02ab50cb851a91891d198e957
25 files changed
+163
-25
pnpm-lock.yaml
+5
-5
@@ -582,8 +582,8 @@ importers:
582
ts/packages/core:
583
dependencies:
584
'@composio/client':
585
- specifier: 0.1.0-alpha.27
586
- version: 0.1.0-alpha.27
585
+ specifier: 0.1.0-alpha.29
586
+ version: 0.1.0-alpha.29
587
'@composio/json-schema-to-zod':
588
specifier: 0.1.10-next.5
589
version: 0.1.10-next.5
@@ -1132,8 +1132,8 @@ packages:
1132
'@composio/client@0.1.0-alpha.17':
1133
resolution: {integrity: sha512-iNCDSgdwfFVsjbbyZIMknMPy4uO8Xw5+MP2aI+yoQo34VXF17Fi6ZHYirrJPf8RbdoRROZTDJjC/rU18mMzC2Q==}
1134
1135
- '@composio/client@0.1.0-alpha.27':
1136
- resolution: {integrity: sha512-IMjiJg8P9OVILmm0zDbshxvwCTzQg7Unxy4ighYp91z1BELakO9lBNSFWU4kRhSS9Tow/RiuBO63bNhPAT00cA==}
1135
+ '@composio/client@0.1.0-alpha.29':
1136
+ resolution: {integrity: sha512-0oI38Kl8LVEK/fFF7rTdvO11uwSWHzavTTUWE/ExnhIoik3wmHse1CRKywb06M+hkLO4+Vdkh46sXbNFs7YZyQ==}
1137
1138
'@composio/json-schema-to-zod@0.1.10-next.5':
1139
resolution: {integrity: sha512-nWPq/uC6aOhrmexuC7HjIzwgZSpiI/B/Yn1Bi1NS1VWcJlLBTWJyEE/dh1Hd0TVEQJdyCMCBVRo00STLDW2EQw==}
@@ -6907,7 +6907,7 @@ snapshots:
6907
6908
'@composio/client@0.1.0-alpha.17': {}
6909
6910
- '@composio/client@0.1.0-alpha.27': {}
6910
+ '@composio/client@0.1.0-alpha.29': {}
6911
6912
'@composio/json-schema-to-zod@0.1.10-next.5':
6913
dependencies:
python/composio/core/models/_modifiers.py
+1
@@ -14,6 +14,7 @@ class ToolExecuteParams(te.TypedDict):
14
arguments: t.Dict
15
connected_account_id: t.Optional[str]
16
custom_auth_params: t.Optional["tool_execute_params.CustomAuthParams"]
17
+ custom_connection_data: t.Optional["tool_execute_params.CustomConnectionData"]
18
user_id: t.Optional[str]
19
text: t.Optional[str]
20
version: t.Optional[str]
python/composio/core/models/auth_configs.py
+2
-2
@@ -95,8 +95,8 @@ class AuthConfigs(Resource):
95
nanoid=nanoid,
96
type=options["type"], # type: ignore
97
credentials=options.get("credentials", self._client.not_given),
98
- restrict_to_following_tools=options.get(
99
- "restrict_to_following_tools", self._client.not_given
98
+ tool_access_config=options.get(
99
+ "tool_access_config", self._client.not_given
100
),
101
),
102
)
python/composio/core/models/toolkits.py
+3
-1
@@ -84,7 +84,9 @@ class Toolkits(Resource):
84
toolkit={"slug": toolkit},
85
auth_config={
86
"type": "use_composio_managed_auth",
87
- "restrict_to_following_tools": [toolkit],
87
+ "tool_access_config": {
88
+ "tools_for_connected_account_creation": [toolkit],
89
+ },
90
},
91
).auth_config.id
92
python/composio/core/models/tools.py
+11
-1
@@ -125,7 +125,7 @@ class Tools(Resource, t.Generic[TProvider]):
125
),
126
search=search if search else self._client.not_given,
127
scopes=scopes,
128
- limit=str(limit) if limit is not None else self._client.not_given,
128
+ limit=limit,
129
).items
130
)
131
return tools_list
@@ -307,6 +307,7 @@ class Tools(Resource, t.Generic[TProvider]):
307
arguments: t.Dict,
308
connected_account_id: t.Optional[str] = None,
309
custom_auth_params: t.Optional[tool_execute_params.CustomAuthParams] = None,
310
+ custom_connection_data: t.Optional[tool_execute_params.CustomConnectionData] = None,
311
user_id: t.Optional[str] = None,
312
text: t.Optional[str] = None,
313
version: t.Optional[str] = None,
@@ -319,6 +320,7 @@ class Tools(Resource, t.Generic[TProvider]):
320
arguments=arguments,
321
connected_account_id=connected_account_id or self._client.not_given,
322
custom_auth_params=custom_auth_params or self._client.not_given,
323
+ custom_connection_data=custom_connection_data or self._client.not_given,
324
user_id=user_id or self._client.not_given,
325
text=text or self._client.not_given,
326
version=version or self._client.not_given,
@@ -337,6 +339,7 @@ class Tools(Resource, t.Generic[TProvider]):
339
*,
340
connected_account_id: t.Optional[str] = None,
341
custom_auth_params: t.Optional[tool_execute_params.CustomAuthParams] = None,
342
+ custom_connection_data: t.Optional[tool_execute_params.CustomConnectionData] = None,
343
user_id: t.Optional[str] = None,
344
text: t.Optional[str] = None,
345
version: t.Optional[str] = None,
@@ -353,6 +356,7 @@ class Tools(Resource, t.Generic[TProvider]):
356
:param arguments: The arguments to pass to the tool.
357
:param connected_account_id: The ID of the connected account to use for the tool.
358
:param custom_auth_params: The custom auth params to use for the tool.
359
+ :param custom_connection_data: The custom connection data to use for the tool, takes priority over custom_auth_params.
360
:param user_id: The ID of the user to execute the tool for.
361
:param text: The text to pass to the tool.
362
:param version: The version of the tool to execute.
@@ -377,6 +381,7 @@ class Tools(Resource, t.Generic[TProvider]):
381
request={
382
"connected_account_id": connected_account_id,
383
"custom_auth_params": custom_auth_params,
384
+ "custom_connection_data": custom_connection_data,
385
"version": version,
386
"text": text,
387
"user_id": user_id,
@@ -385,6 +390,7 @@ class Tools(Resource, t.Generic[TProvider]):
390
)
391
connected_account_id = processed_params["connected_account_id"]
392
custom_auth_params = processed_params["custom_auth_params"]
393
+ custom_connection_data = processed_params["custom_connection_data"]
394
text = processed_params["text"]
395
version = processed_params["version"]
396
user_id = processed_params["user_id"]
@@ -402,6 +408,7 @@ class Tools(Resource, t.Generic[TProvider]):
408
arguments=arguments,
409
connected_account_id=connected_account_id,
410
custom_auth_params=custom_auth_params,
411
+ custom_connection_data=custom_connection_data,
412
user_id=user_id,
413
text=text,
414
version=version,
@@ -433,6 +440,9 @@ class Tools(Resource, t.Generic[TProvider]):
440
"connected_account_id", self._client.not_given
441
),
442
parameters=options.get("parameters", self._client.not_given),
443
+ custom_connection_data=options.get(
444
+ "custom_connection_data", self._client.not_given
445
+ ),
446
)
447
448
python/examples/auth_configs.py
+3
-1
@@ -58,7 +58,9 @@ auth_config_updated = composio.auth_configs.update(
58
"client_id": "1234567890",
59
"client_secret": "1234567890",
60
},
61
- "restrict_to_following_tools": ["github"],
61
+ "tool_access_config": {
62
+ "tools_for_connected_account_creation": ["github"],
63
+ },
64
},
65
)
66
print(auth_config_updated)
python/pyproject.toml
+1
-1
@@ -7,7 +7,7 @@ requires-python = ">=3.10,<4"
7
dependencies = [
8
"pysher>=1.0.8",
9
"pydantic>=2.6.4",
10
- "composio-client==1.4.0",
10
+ "composio-client==1.6.0",
11
"typing-extensions>=4.0.0",
12
"openai",
13
]
ts/docs/api/tools.md
+1
@@ -252,6 +252,7 @@ interface ToolExecuteParams {
252
allowTracing?: boolean; // Enable/disable tracing
253
connectedAccountId?: string; // Connected account ID
254
customAuthParams?: CustomAuthParams; // Custom auth parameters
255
+ customConnectionData?: CustomConnectionData; // Custom connection data
256
arguments?: Record<string, unknown>; // Tool arguments
257
userId: string; // User ID
258
version?: string; // Tool version
ts/packages/core/package.json
+1
-1
@@ -44,7 +44,7 @@
44
"vitest": "^3.1.4"
45
},
46
"dependencies": {
47
- "@composio/client": "0.1.0-alpha.27",
47
+ "@composio/client": "0.1.0-alpha.29",
48
"@composio/json-schema-to-zod": "0.1.10-next.5",
49
"@types/json-schema": "^7.0.15",
50
"chalk": "^4.1.2",
ts/packages/core/src/models/AuthConfigs.ts
+12
-4
@@ -133,13 +133,17 @@ export class AuthConfigs {
133
name: parsedOptions.data.name,
134
authScheme: parsedOptions.data.authScheme,
135
credentials: parsedOptions.data.credentials,
136
- restrict_to_following_tools: parsedOptions.data.restrictToFollowingTools,
136
+ tool_access_config: {
137
+ tools_for_connected_account_creation: parsedOptions.data.restrictToFollowingTools,
138
+ },
139
}
140
: {
141
type: parsedOptions.data.type,
142
credentials: parsedOptions.data.credentials,
143
name: parsedOptions.data.name,
142
- restrict_to_following_tools: parsedOptions.data.restrictToFollowingTools,
144
+ tool_access_config: {
145
+ tools_for_connected_account_creation: parsedOptions.data.restrictToFollowingTools,
146
+ },
147
},
148
});
149
return transformCreateAuthConfigResponse(result);
@@ -212,12 +216,16 @@ export class AuthConfigs {
216
? {
217
type: 'custom',
218
credentials: parsedData.data.credentials,
215
- restrict_to_following_tools: parsedData.data.restrictToFollowingTools,
219
+ tool_access_config: {
220
+ tools_for_connected_account_creation: parsedData.data.restrictToFollowingTools,
221
+ },
222
}
223
: {
224
type: 'default',
225
scopes: parsedData.data.scopes,
220
- restrict_to_following_tools: parsedData.data.restrictToFollowingTools,
226
+ tool_access_config: {
227
+ tools_for_connected_account_creation: parsedData.data.restrictToFollowingTools,
228
+ },
229
}
230
);
231
}
ts/packages/core/src/models/CustomTools.ts
+1
@@ -303,6 +303,7 @@ export class CustomTools {
303
parameters: parameters,
304
body: data.body,
305
connected_account_id: data.connectedAccountId ?? connectedAccountId,
306
+ custom_connection_data: data.customConnectionData,
307
});
308
309
return {
ts/packages/core/src/models/Tools.ts
+2
@@ -704,6 +704,7 @@ export class Tools<
704
allow_tracing: body.allowTracing,
705
connected_account_id: body.connectedAccountId,
706
custom_auth_params: body.customAuthParams,
707
+ custom_connection_data: body.customConnectionData,
708
arguments: body.arguments,
709
user_id: body.userId,
710
version: body.version,
@@ -890,6 +891,7 @@ export class Tools<
891
body: toolProxyParams.data.body,
892
connected_account_id: toolProxyParams.data.connectedAccountId,
893
parameters: parameters,
894
+ custom_connection_data: toolProxyParams.data.customConnectionData,
895
});
896
}
897
ts/packages/core/src/provider/OpenAIProvider.ts
+1
@@ -183,6 +183,7 @@ export class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection,
183
arguments: JSON.parse(tool.function.arguments),
184
connectedAccountId: options?.connectedAccountId,
185
customAuthParams: options?.customAuthParams,
186
+ customConnectionData: options?.customConnectionData,
187
userId: userId,
188
};
189
const result = await this.executeTool(tool.function.name, payload, modifiers);
ts/packages/core/src/types/connectedAccountAuthStates.types.ts
+73
-1
@@ -91,7 +91,7 @@ export const Oauth2ActiveConnectionDataSchema = Oauth2InitiatingConnectionDataSc
91
access_token: z.string().optional(),
92
id_token: z.string().optional(),
93
token_type: z.string().optional(),
94
- refresh_token: z.string().optional(),
94
+ refresh_token: z.string().nullish(),
95
expires_in: z.union([z.string(), z.number(), z.null()]).optional(),
96
scope: z.union([z.string(), z.array(z.string())]).optional(),
97
// previously verification_token, will be sent as verification_token to slack
@@ -129,6 +129,13 @@ export const Oauth2ConnectionDataSchema = z.discriminatedUnion('status', [
129
Oauth2InactiveConnectionDataSchema,
130
]);
131
132
+export const CustomOauth2ConnectionDataSchema = Oauth2ActiveConnectionDataSchema.omit({
133
+ status: true,
134
+ access_token: true,
135
+}).extend({
136
+ access_token: z.string(),
137
+});
138
+
139
export type Oauth2InitiatingConnectionData = z.infer<typeof Oauth2InitiatingConnectionDataSchema>;
140
export type Oauth2InitiatedConnectionData = z.infer<typeof Oauth2InitiatedConnectionDataSchema>;
141
export type Oauth2ActiveConnectionData = z.infer<typeof Oauth2ActiveConnectionDataSchema>;
@@ -136,6 +143,7 @@ export type Oauth2FailedConnectionData = z.infer<typeof Oauth2FailedConnectionDa
143
export type Oauth2ExpiredConnectionData = z.infer<typeof Oauth2ExpiredConnectionDataSchema>;
144
export type Oauth2InactiveConnectionData = z.infer<typeof Oauth2InactiveConnectionDataSchema>;
145
export type Oauth2ConnectionData = z.infer<typeof Oauth2ConnectionDataSchema>;
146
+export type CustomOauth2ConnectionData = z.infer<typeof CustomOauth2ConnectionDataSchema>;
147
148
// OAUTH1
149
export const Oauth1InitiatingConnectionDataSchema = BaseSchemeRaw.extend({
@@ -183,6 +191,14 @@ export const Oauth1ConnectionDataSchema = z.discriminatedUnion('status', [
191
Oauth1InactiveConnectionDataSchema,
192
]);
193
194
+export const CustomOauth1ConnectionDataSchema = Oauth1ActiveConnectionDataSchema.omit({
195
+ status: true,
196
+ oauth_token: true,
197
+}).extend({
198
+ oauth_token_secret: z.string(),
199
+ oauth_token: z.string(),
200
+});
201
+
202
export type Oauth1InitiatingConnectionData = z.infer<typeof Oauth1InitiatingConnectionDataSchema>;
203
export type Oauth1InitiatedConnectionData = z.infer<typeof Oauth1InitiatedConnectionDataSchema>;
204
export type Oauth1ActiveConnectionData = z.infer<typeof Oauth1ActiveConnectionDataSchema>;
@@ -190,6 +206,7 @@ export type Oauth1FailedConnectionData = z.infer<typeof Oauth1FailedConnectionDa
206
export type Oauth1ExpiredConnectionData = z.infer<typeof Oauth1ExpiredConnectionDataSchema>;
207
export type Oauth1InactiveConnectionData = z.infer<typeof Oauth1InactiveConnectionDataSchema>;
208
export type Oauth1ConnectionData = z.infer<typeof Oauth1ConnectionDataSchema>;
209
+export type CustomOauth1ConnectionData = z.infer<typeof CustomOauth1ConnectionDataSchema>;
210
211
// COMPOSIO_LINK_AUTH
212
const ComposioLinkInitiatingSchema = BaseSchemeRaw.extend({
@@ -268,6 +285,9 @@ const BasicConnectionDataSchema = z.discriminatedUnion('status', [
285
expired_at: z.string().optional(),
286
}).catchall(z.unknown()),
287
]);
288
+const CustomBasicConnectionDataSchema = BasicInitiatingSchema.omit({
289
+ status: true,
290
+});
291
292
// API_KEY
293
const ApiKeyInitiatingSchema = BaseSchemeRaw.extend({
@@ -290,6 +310,9 @@ const ApiKeyConnectionDataSchema = z.discriminatedUnion('status', [
310
expired_at: z.string().optional(),
311
}).catchall(z.unknown()),
312
]);
313
+const CustomApiKeyConnectionDataSchema = ApiKeyInitiatingSchema.omit({
314
+ status: true,
315
+});
316
317
// BEARER_TOKEN
318
const BearerTokenInitiatingSchema = BaseSchemeRaw.extend({
@@ -311,6 +334,9 @@ const BearerTokenConnectionDataSchema = z.discriminatedUnion('status', [
334
expired_at: z.string().optional(),
335
}).catchall(z.unknown()),
336
]);
337
+const CustomBearerTokenConnectionDataSchema = BearerTokenInitiatingSchema.omit({
338
+ status: true,
339
+});
340
341
// GOOGLE_SERVICE_ACCOUNT
342
const GoogleServiceAccountInitiatingSchema = BaseSchemeRaw.extend({
@@ -352,6 +378,9 @@ const NoAuthConnectionDataSchema = z.discriminatedUnion('status', [
378
expired_at: z.string().optional(),
379
}).catchall(z.unknown()),
380
]);
381
+const CustomNoAuthConnectionDataSchema = NoAuthInitiatingSchema.omit({
382
+ status: true,
383
+});
384
385
// CALCOM_AUTH
386
const CalcomAuthInitiatingSchema = BaseSchemeRaw.extend({
@@ -411,6 +440,9 @@ const BasicWithJwtConnectionDataSchema = z.discriminatedUnion('status', [
440
expired_at: z.string().optional(),
441
}).catchall(z.unknown()),
442
]);
443
+const CustomBasicWithJwtConnectionDataSchema = BasicWithJwtInitiatingSchema.omit({
444
+ status: true,
445
+});
446
447
export const ConnectionDataSchema = z.discriminatedUnion('authScheme', [
448
z.object({
@@ -500,3 +532,43 @@ export const ConnectionDataSchema = z.discriminatedUnion('authScheme', [
532
]);
533
534
export type ConnectionData = z.infer<typeof ConnectionDataSchema>;
535
+
536
+export const CustomConnectionDataSchema = z.discriminatedUnion('authScheme', [
537
+ z.object({
538
+ authScheme: z.literal(AuthSchemeTypes.OAUTH2),
539
+ toolkitSlug: z.string(),
540
+ val: CustomOauth2ConnectionDataSchema,
541
+ }),
542
+ z.object({
543
+ authScheme: z.literal(AuthSchemeTypes.API_KEY),
544
+ toolkitSlug: z.string(),
545
+ val: CustomApiKeyConnectionDataSchema,
546
+ }),
547
+ z.object({
548
+ authScheme: z.literal(AuthSchemeTypes.BASIC_WITH_JWT),
549
+ toolkitSlug: z.string(),
550
+ val: CustomBasicWithJwtConnectionDataSchema,
551
+ }),
552
+ z.object({
553
+ authScheme: z.literal(AuthSchemeTypes.BASIC),
554
+ toolkitSlug: z.string(),
555
+ val: CustomBasicConnectionDataSchema,
556
+ }),
557
+ z.object({
558
+ authScheme: z.literal(AuthSchemeTypes.BEARER_TOKEN),
559
+ toolkitSlug: z.string(),
560
+ val: CustomBearerTokenConnectionDataSchema,
561
+ }),
562
+ z.object({
563
+ authScheme: z.literal(AuthSchemeTypes.OAUTH1),
564
+ toolkitSlug: z.string(),
565
+ val: CustomOauth1ConnectionDataSchema,
566
+ }),
567
+ z.object({
568
+ authScheme: z.literal(AuthSchemeTypes.NO_AUTH),
569
+ toolkitSlug: z.string(),
570
+ val: CustomNoAuthConnectionDataSchema,
571
+ }),
572
+]);
573
+
574
+export type CustomConnectionData = z.infer<typeof CustomConnectionDataSchema>;
ts/packages/core/src/types/provider.types.ts
+2
@@ -6,6 +6,7 @@ import {
6
ToolExecuteResponse,
7
ToolListParams,
8
} from './tool.types';
9
+import { CustomConnectionData } from './connectedAccountAuthStates.types';
10
11
/**
12
* Base provider implementation, which needs to be implemented by the extended class.
@@ -20,6 +21,7 @@ export interface Provider<TTool, TToolCollection> {
21
export type ExecuteToolFnOptions = {
22
connectedAccountId?: string;
23
customAuthParams?: CustomAuthParams;
24
+ customConnectionData?: CustomConnectionData;
25
};
26
27
/**
ts/packages/core/src/types/tool.types.ts
+3
@@ -1,4 +1,5 @@
1
import { z } from 'zod';
2
+import { CustomConnectionDataSchema } from './connectedAccountAuthStates.types';
3
4
/**
5
* Toolkit is the collection of tools,
@@ -232,6 +233,7 @@ export const ToolExecuteParamsSchema = z.object({
233
allowTracing: z.boolean().optional(),
234
connectedAccountId: z.string().optional(),
235
customAuthParams: CustomAuthParamsSchema.optional(),
236
+ customConnectionData: CustomConnectionDataSchema.optional(),
237
arguments: z.record(z.string(), z.unknown()).optional(),
238
userId: z.string(),
239
version: z.string().optional(),
@@ -265,5 +267,6 @@ export const ToolProxyParamsSchema = z.object({
267
)
268
.optional(),
269
connectedAccountId: z.string().optional(),
270
+ customConnectionData: CustomConnectionDataSchema.optional(),
271
});
272
export type ToolProxyParams = z.infer<typeof ToolProxyParamsSchema>;
ts/packages/core/src/utils/transformers/authConfigs.ts
+1
-1
@@ -48,7 +48,7 @@ export function transformAuthConfigRetrieveResponse(
48
createdBy: authConfig.created_by,
49
createdAt: authConfig.created_at,
50
lastUpdatedAt: authConfig.last_updated_at,
51
- restrictToFollowingTools: authConfig.restrict_to_following_tools,
51
+ restrictToFollowingTools: authConfig.tool_access_config?.tools_for_connected_account_creation,
52
}));
53
}
54
ts/packages/core/test/AuthConfigs/authConfigs.test.ts
+27
-7
@@ -42,6 +42,9 @@ const mockComposioAuthConfigResponse: ComposioAuthConfigRetrieveResponse = {
42
created_by: 'user_123',
43
created_at: '2023-01-01T00:00:00Z',
44
last_updated_at: '2023-01-01T00:00:00Z',
45
+ tool_access_config: {
46
+ tools_for_connected_account_creation: undefined,
47
+ },
48
};
49
50
const mockTransformedAuthConfigResponse = {
@@ -257,6 +260,9 @@ describe('AuthConfigs', () => {
260
},
261
auth_config: {
262
type: 'use_composio_managed_auth',
263
+ tool_access_config: {
264
+ tools_for_connected_account_creation: undefined,
265
+ },
266
},
267
});
268
@@ -280,6 +286,9 @@ describe('AuthConfigs', () => {
286
const options = {
287
type: 'use_custom_auth' as const,
288
name: 'Custom GitHub Auth',
289
+ tool_access_config: {
290
+ tools_for_connected_account_creation: undefined,
291
+ },
292
authScheme: 'OAUTH2' as const,
293
credentials: {
294
client_id: 'test_client_id',
@@ -310,6 +319,9 @@ describe('AuthConfigs', () => {
319
const options = {
320
type: 'use_composio_managed_auth' as const,
321
name: 'My GitHub Config',
322
+ tool_access_config: {
323
+ tools_for_connected_account_creation: undefined,
324
+ },
325
credentials: {
326
custom_field: 'value',
327
},
@@ -381,7 +393,6 @@ describe('AuthConfigs', () => {
393
client_id: 'new_client_id',
394
client_secret: 'new_client_secret',
395
},
384
- restrictToFollowingTools: ['repo', 'user'],
396
};
397
398
const result = await authConfigs.update('auth_12345', updateData);
@@ -392,7 +403,9 @@ describe('AuthConfigs', () => {
403
client_id: 'new_client_id',
404
client_secret: 'new_client_secret',
405
},
395
- restrict_to_following_tools: ['repo', 'user'],
406
+ tool_access_config: {
407
+ tools_for_connected_account_creation: undefined,
408
+ },
409
});
410
411
expect(result).toEqual(mockUpdateResponse);
@@ -404,7 +417,6 @@ describe('AuthConfigs', () => {
417
const updateData = {
418
type: 'default' as const,
419
scopes: 'read:user,repo',
407
- restrictToFollowingTools: ['repo'],
420
};
421
422
const result = await authConfigs.update('auth_12345', updateData);
@@ -412,7 +424,9 @@ describe('AuthConfigs', () => {
424
expect(mockClient.authConfigs.update).toHaveBeenCalledWith('auth_12345', {
425
type: 'default',
426
scopes: 'read:user,repo',
415
- restrict_to_following_tools: ['repo'],
427
+ tool_access_config: {
428
+ tools_for_connected_account_creation: undefined,
429
+ },
430
});
431
432
expect(result).toEqual(mockUpdateResponse);
@@ -435,7 +449,9 @@ describe('AuthConfigs', () => {
449
credentials: {
450
api_key: 'new_api_key',
451
},
438
- restrict_to_following_tools: undefined,
452
+ tool_access_config: {
453
+ tools_for_connected_account_creation: undefined,
454
+ },
455
});
456
457
expect(result).toEqual(mockUpdateResponse);
@@ -687,7 +703,9 @@ describe('AuthConfigs', () => {
703
expect(mockClient.authConfigs.update).toHaveBeenCalledWith('auth_12345', {
704
type: 'custom',
705
credentials: largeCredentials,
690
- restrict_to_following_tools: undefined,
706
+ tool_access_config: {
707
+ tools_for_connected_account_creation: undefined,
708
+ },
709
});
710
711
expect(result).toEqual(mockUpdateResponse);
@@ -713,7 +731,9 @@ describe('AuthConfigs', () => {
731
expect(mockClient.authConfigs.update).toHaveBeenCalledWith('auth_12345', {
732
type: 'default',
733
scopes: longScopes,
716
- restrict_to_following_tools: undefined,
734
+ tool_access_config: {
735
+ tools_for_connected_account_creation: undefined,
736
+ },
737
});
738
739
expect(result).toEqual(mockUpdateResponse);
ts/packages/core/test/models/toolkits.test.ts
+6
@@ -270,6 +270,9 @@ describe('Toolkits', () => {
270
is_composio_managed: true,
271
is_disabled: false,
272
name: 'Test Toolkit Auth Config',
273
+ tool_access_config: {
274
+ tools_for_connected_account_creation: undefined,
275
+ },
276
no_of_connections: 0,
277
status: 'ENABLED',
278
uuid: 'uuid-1',
@@ -314,6 +317,9 @@ describe('Toolkits', () => {
317
auth_config: {
318
type: 'use_composio_managed_auth',
319
name: 'Test Toolkit Auth Config',
320
+ tool_access_config: {
321
+ tools_for_connected_account_creation: undefined,
322
+ },
323
},
324
});
325
expect(mockClient.connectedAccounts.create).toHaveBeenCalledWith({
ts/packages/core/test/tools/fileModifiers.test.ts
+1
@@ -416,6 +416,7 @@ describe('Tools with autoUploadDownloadFiles', () => {
416
allow_tracing: undefined,
417
connected_account_id: undefined,
418
custom_auth_params: undefined,
419
+ custom_connection_data: undefined,
420
text: undefined,
421
user_id: 'test-user',
422
version: undefined,
ts/packages/core/test/tools/tools.test.ts
+2
@@ -414,6 +414,7 @@ describe('Tools', () => {
414
allow_tracing: undefined,
415
connected_account_id: undefined,
416
custom_auth_params: undefined,
417
+ custom_connection_data: undefined,
418
arguments: body.arguments,
419
user_id: body.userId,
420
version: undefined,
@@ -438,6 +439,7 @@ describe('Tools', () => {
439
allow_tracing: undefined,
440
connected_account_id: 'test-connected-account-id',
441
custom_auth_params: undefined,
442
+ custom_connection_data: undefined,
443
arguments: body.arguments,
444
user_id: body.userId,
445
version: undefined,
ts/packages/providers/anthropic/src/index.ts
+1
@@ -214,6 +214,7 @@ export class AnthropicProvider extends BaseNonAgenticProvider<
214
arguments: toolUse.input,
215
connectedAccountId: options?.connectedAccountId,
216
customAuthParams: options?.customAuthParams,
217
+ customConnectionData: options?.customConnectionData,
218
userId: userId,
219
};
220
const result = await this.executeTool(toolUse.name, payload, modifiers);
ts/packages/providers/cloudflare/src/index.ts
+1
@@ -232,6 +232,7 @@ export class CloudflareProvider extends BaseNonAgenticProvider<
232
arguments: typeof tool.arguments === 'string' ? JSON.parse(tool.arguments) : tool.arguments,
233
connectedAccountId: options.connectedAccountId,
234
customAuthParams: options.customAuthParams,
235
+ customConnectionData: options.customConnectionData,
236
userId: userId,
237
};
238
ts/packages/providers/google/src/index.ts
+1
@@ -241,6 +241,7 @@ export class GoogleProvider extends BaseNonAgenticProvider<GoogleGenAIToolCollec
241
arguments: tool.args,
242
connectedAccountId: options?.connectedAccountId,
243
customAuthParams: options?.customAuthParams,
244
+ customConnectionData: options?.customConnectionData,
245
userId: userId,
246
};
247
ts/packages/providers/openai/src/OpenAIResponsesProvider.ts
+1
@@ -229,6 +229,7 @@ export class OpenAIResponsesProvider extends BaseNonAgenticProvider<
229
arguments: JSON.parse(tool.arguments),
230
connectedAccountId: options?.connectedAccountId,
231
customAuthParams: options?.customAuthParams,
232
+ customConnectionData: options?.customConnectionData,
233
userId: userId,
234
};
235
const result = await this.executeTool(tool.name, payload, modifiers);