Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
feat: add auth config ids support in fetching tools (#1742)
Himanshu Dixit8bba19c6a106
diff --git a/.changeset/dirty-shoes-rhyme.md b/.changeset/dirty-shoes-rhyme.mdnew file mode 100644index 000000000..07780a06e--- /dev/null+++ b/.changeset/dirty-shoes-rhyme.md@@ -0,0 +1,13 @@+---+'@composio/core': minor+'@composio/anthropic': minor+'@composio/cloudflare': minor+'@composio/google': minor+'@composio/langchain': minor+'@composio/mastra': minor+'@composio/openai': minor+'@composio/openai-agents': minor+'@composio/vercel': minor+---++add auth config ids supportdiff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 750c09440..1bec3dc1e 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -196,7 +196,7 @@ importers:devDependencies:'@cloudflare/vitest-pool-workers':specifier: ^0.8.19- version: 0.8.44(@cloudflare/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected])+ version: 0.8.44(@cloudflare/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected]))typescript:specifier: ^5.5.2version: 5.8.3@@ -537,7 +537,7 @@ importers:version: 3.16.8effect-errors:specifier: ^1.10.11- version: 1.10.11(aee16c6ba0d05f0cbe9c66fcd0455e75)+ version: 1.10.11(dv5vjw6z3xfcz4ohf6dr5p6h5i)indent-string:specifier: ^5.0.0version: 5.0.0@@ -556,7 +556,7 @@ importers:version: 0.85.2([email protected])'@effect/vitest':specifier: ^0.23.8- version: 0.23.8([email protected])([email protected])+ version: 0.23.8([email protected])([email protected](@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected]))'@types/bun':specifier: ^1.2.16version: 1.2.16@@ -582,8 +582,8 @@ importers:ts/packages/core:dependencies:'@composio/client':- specifier: 0.1.0-alpha.25- version: 0.1.0-alpha.25+ specifier: 0.1.0-alpha.27+ version: 0.1.0-alpha.27'@composio/json-schema-to-zod':specifier: 0.1.10-next.3version: 0.1.10-next.3@@ -708,7 +708,7 @@ importers:dependencies:'@langchain/core':specifier: ^0.3.44+ version: 0.3.58([email protected]([email protected]))devDependencies:'@composio/core':specifier: workspace:*@@ -1132,8 +1132,8 @@ packages:'@composio/[email protected]':resolution: {integrity: sha512-iNCDSgdwfFVsjbbyZIMknMPy4uO8Xw5+MP2aI+yoQo34VXF17Fi6ZHYirrJPf8RbdoRROZTDJjC/rU18mMzC2Q==}- '@composio/[email protected]':- resolution: {integrity: sha512-5zbqn3zxSoIs4MtfuEKZ3p+xE6Is/PPh77ldoIT9iBYvZrw9RsqA7Xlyw5PgbIiG3QPoeRSpEAnjwBoVwU8ehQ==}+ '@composio/[email protected]':+ resolution: {integrity: sha512-IMjiJg8P9OVILmm0zDbshxvwCTzQg7Unxy4ighYp91z1BELakO9lBNSFWU4kRhSS9Tow/RiuBO63bNhPAT00cA==}'@composio/[email protected]':resolution: {integrity: sha512-kglZdteq+18Tcikb1US7D47VX3A3x8haeE+qFCwpQbBAgp3vG+eMQnZ6WgMkLNroZNrTm5oiAJrSdjerbiAqIA==}@@ -6853,7 +6853,7 @@ snapshots:optionalDependencies:workerd: 1.20250617.0- '@cloudflare/[email protected](@cloudflare/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected])':+ '@cloudflare/[email protected](@cloudflare/[email protected])(@vitest/[email protected])(@vitest/[email protected])([email protected](@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected]))':dependencies:'@vitest/runner': 3.2.4'@vitest/snapshot': 3.2.4@@ -6889,7 +6889,7 @@ snapshots:'@composio/[email protected]': {}- '@composio/[email protected]': {}+ '@composio/[email protected]': {}'@composio/[email protected]':dependencies:@@ -7027,7 +7027,7 @@ snapshots:dependencies:effect: 3.16.8+ '@effect/[email protected]([email protected])([email protected](@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected]))':dependencies:effect: 3.16.8vitest: 3.2.4(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected])@@ -7585,14 +7585,14 @@ snapshots:'@jsdevtools/[email protected]': {}dependencies:'@cfworker/json-schema': 4.1.1ansi-styles: 5.2.0camelcase: 6.3.0decamelize: 1.2.0js-tiktoken: 1.0.20+ langsmith: 0.3.31([email protected]([email protected]))mustache: 4.2.0p-queue: 6.6.2p-retry: 4.6.2@@ -9299,6 +9299,14 @@ snapshots:chai: 5.2.0tinyrainbow: 2.0.0+ '@vitest/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected]))':+ dependencies:+ '@vitest/spy': 3.2.4+ estree-walker: 3.0.3+ magic-string: 0.30.17+ optionalDependencies:+'@vitest/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected]))':dependencies:'@vitest/spy': 3.2.4@@ -9307,6 +9315,14 @@ snapshots:optionalDependencies:+ '@vitest/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected]))':+ dependencies:+ '@vitest/spy': 3.2.4+ estree-walker: 3.0.3+ magic-string: 0.30.17+ optionalDependencies:+'@vitest/[email protected]':dependencies:tinyrainbow: 2.0.0@@ -9832,7 +9848,7 @@ snapshots:- [email protected](aee16c6ba0d05f0cbe9c66fcd0455e75):+ [email protected](dv5vjw6z3xfcz4ohf6dr5p6h5i):dependencies:'@effect/cluster': 0.39.4(@effect/[email protected]([email protected]))(@effect/[email protected](@effect/[email protected]([email protected]))([email protected]))(@effect/[email protected](@effect/[email protected](@effect/[email protected]([email protected]))([email protected]))(@effect/[email protected]([email protected]))([email protected]))(@effect/[email protected](@effect/[email protected]([email protected]))(@effect/[email protected](@effect/[email protected]([email protected]))([email protected]))([email protected]))([email protected])'@effect/platform': 0.85.2([email protected])@@ -10666,7 +10682,7 @@ snapshots:- openai- wsdependencies:'@types/uuid': 10.0.0chalk: 4.1.2@@ -12167,7 +12183,7 @@ snapshots:dependencies:'@types/chai': 5.2.2'@vitest/expect': 3.2.4- '@vitest/mocker': 3.2.4([email protected](@types/[email protected])([email protected])([email protected])([email protected]))+ '@vitest/mocker': 3.2.4([email protected](@types/[email protected])([email protected])([email protected])([email protected]))'@vitest/pretty-format': 3.2.4'@vitest/runner': 3.2.4'@vitest/snapshot': 3.2.4@@ -12251,7 +12267,7 @@ snapshots:dependencies:'@types/chai': 5.2.2'@vitest/expect': 3.2.4- '@vitest/mocker': 3.2.4([email protected](@types/[email protected])([email protected])([email protected])([email protected]))+ '@vitest/mocker': 3.2.4([email protected](@types/[email protected])([email protected])([email protected])([email protected]))'@vitest/pretty-format': 3.2.4'@vitest/runner': 3.2.4'@vitest/snapshot': 3.2.4diff --git a/ts/packages/core/package.json b/ts/packages/core/package.jsonindex 1c3a25b04..f7a4505d5 100644--- a/ts/packages/core/package.json+++ b/ts/packages/core/package.json@@ -43,7 +43,7 @@"vitest": "^3.1.4"},"dependencies": {- "@composio/client": "0.1.0-alpha.25",+ "@composio/client": "0.1.0-alpha.27","@composio/json-schema-to-zod": "0.1.10-next.3","@types/json-schema": "^7.0.15","chalk": "^4.1.2",diff --git a/ts/packages/core/src/models/ConnectedAccounts.ts b/ts/packages/core/src/models/ConnectedAccounts.tsindex f0fc908eb..fabd91af6 100644--- a/ts/packages/core/src/models/ConnectedAccounts.ts+++ b/ts/packages/core/src/models/ConnectedAccounts.ts@@ -86,7 +86,7 @@ export class ConnectedAccounts {}rawQuery = {auth_config_ids: parsedQuery.data.authConfigIds,- cursor: parsedQuery.data.cursor,+ cursor: parsedQuery.data.cursor?.toString(),labels: parsedQuery.data.labels,limit: parsedQuery.data.limit,order_by: parsedQuery.data.orderBy,diff --git a/ts/packages/core/src/models/Tools.ts b/ts/packages/core/src/models/Tools.tsindex 605d8b27c..05d8b932a 100644--- a/ts/packages/core/src/models/Tools.ts+++ b/ts/packages/core/src/models/Tools.ts@@ -398,9 +398,9 @@ export class Tools<}// if tools are provided, set the limit to 9999 so that all tools are fetched- let limit = 'limit' in queryParams.data ? queryParams.data.limit?.toString() : undefined;+ let limit = 'limit' in queryParams.data ? queryParams.data.limit : undefined;if ('tools' in queryParams.data) {- limit = '9999';+ limit = 9999;}const filters: ComposioToolListParams = {@@ -412,6 +412,9 @@ export class Tools<...('tags' in queryParams.data ? { tags: queryParams.data.tags } : {}),...('scopes' in queryParams.data ? { scopes: queryParams.data.scopes } : {}),...('search' in queryParams.data ? { search: queryParams.data.search } : {}),+ ...('authConfigIds' in queryParams.data+ ? { auth_config_ids: queryParams.data.authConfigIds }+ : {}),};logger.debug(`Fetching tools with filters: ${JSON.stringify(filters, null, 2)}`);diff --git a/ts/packages/core/src/models/Triggers.ts b/ts/packages/core/src/models/Triggers.tsindex 3e82e45c9..bc2fcf921 100644--- a/ts/packages/core/src/models/Triggers.ts+++ b/ts/packages/core/src/models/Triggers.ts@@ -341,7 +341,7 @@ export class Triggers {.with(TriggersTypeListResponseSchema).using(raw => ({items: raw.items,- nextCursor: raw.next_cursor,+ nextCursor: raw.next_cursor ?? null,totalPages: raw.total_pages,}));diff --git a/ts/packages/core/src/types/tool.types.ts b/ts/packages/core/src/types/tool.types.tsindex eb69ba349..aaf170cb9 100644--- a/ts/packages/core/src/types/tool.types.ts+++ b/ts/packages/core/src/types/tool.types.ts@@ -138,8 +138,9 @@ export const ToolListParamsSchema = z.object({toolkits: z.array(z.string()).optional(),scopes: z.array(z.string()).optional(),tags: z.array(z.string()).optional(),- limit: z.number().optional(),+ limit: z.coerce.number().optional(),search: z.string().optional(),+ authConfigIds: z.array(z.string()).optional(),});type BaseParams = {@@ -190,6 +191,12 @@ type SearchOnlyParams = {tags?: never;};+// tools by auth config ids only+type AuthConfigIdsOnlyParams = {+ authConfigIds: string[];+ tools?: never;+ toolkit?: never;+} & Pick<BaseParams, 'limit' | 'search' | 'tags'>;/*** ToolListParams is the parameters for the list of tools.* You must provide either tools or toolkits, but not both.@@ -199,7 +206,8 @@ export type ToolListParams =| ToolkitsOnlyParams| ToolkitScopeOnlyParams| SearchOnlyParams- | TagsOnlyParams;+ | TagsOnlyParams+ | AuthConfigIdsOnlyParams;/*** CustomAuthParams is the parameters for the custom authentication.diff --git a/ts/packages/core/test/tools/tools.test.ts b/ts/packages/core/test/tools/tools.test.tsindex ffc69e85b..73e1229b4 100644--- a/ts/packages/core/test/tools/tools.test.ts+++ b/ts/packages/core/test/tools/tools.test.ts@@ -66,7 +66,7 @@ describe('Tools', () => {expect(mockClient.tools.list).toHaveBeenCalledWith({tool_slugs: 'TOOL1,TOOL2',- limit: '9999',+ limit: 9999,search: undefined,toolkit_slug: undefined,});@@ -89,7 +89,7 @@ describe('Tools', () => {expect(mockClient.tools.list).toHaveBeenCalledWith({tool_slugs: undefined,toolkit_slug: 'github',- limit: '10',+ limit: 10,search: undefined,});});@@ -112,7 +112,7 @@ describe('Tools', () => {expect(mockClient.tools.list).toHaveBeenCalledWith({tool_slugs: undefined,toolkit_slug: 'github',- limit: '10',+ limit: 10,search: 'test',});});@@ -135,7 +135,7 @@ describe('Tools', () => {expect(mockClient.tools.list).toHaveBeenCalledWith({tool_slugs: undefined,toolkit_slug: 'todoist',- limit: '10',+ limit: 10,search: undefined,scopes: ['task:add', 'task:read'],});@@ -160,7 +160,7 @@ describe('Tools', () => {expect(mockClient.tools.list).toHaveBeenCalledWith({tool_slugs: undefined,toolkit_slug: 'todoist',- limit: '10',+ limit: 10,search: 'add task',scopes: ['task:add'],});