Skip to content

[Bug]: Tools.execute ignores explicit toolkitVersion when looking up tools #2471

@timurkin

Description

@timurkin

SDK Language

TypeScript / Node.js SDK (@composio/core)

SDK Version

@composio/core@latest

Runtime Environment

Bun, Node

Environment

Production Deployment

Describe the Bug

If a tool is called with an explicitly specified version (toolkitVersion), but such tool doesn't exist in the toolkit that was specified during the composio client initialization, an error will be thrown: "Unable to retrieve tool with slug ${slug}"
The error occurs because Tools.execute calls getRawComposioToolBySlug without specifying the explicit toolkit version.

Steps to Reproduce

export const composio = new Composio({
  apiKey: config.COMPOSIO_API_KEY,
  toolkitVersions: {
   googlecalendar: '00000000_00',
},
})
...
composioInstance.tools.execute('GOOGLECALENDAR_EVENTS_GET', {
  userId,
  arguments: {
    event_id: googleCalendarEventId,
  },
  version: '20260122_00',
})

Minimal Reproducible Example

export const composio = new Composio({
  apiKey: config.COMPOSIO_API_KEY,
  toolkitVersions: {
   googlecalendar: '00000000_00',
},
})
...
composioInstance.tools.execute('GOOGLECALENDAR_EVENTS_GET', {
  userId,
  arguments: {
    event_id: googleCalendarEventId,
  },
  version: '20260122_00',
})

Error Output / Stack Trace

2323 | 		} else logger_default.debug(`Tool ${slug} is not a custom tool. Fetching from Composio API`);
2324 | 		let tool;
2325 | 		try {
2326 | 			tool = await this.client.tools.retrieve(slug, { toolkit_versions: this.toolkitVersions });
2327 | 		} catch (error) {
2328 | 			throw new ComposioToolNotFoundError(`Unable to retrieve tool with slug ${slug}`, { cause: error });
                    ^
ComposioToolNotFoundError: Unable to retrieve tool with slug GOOGLECALENDAR_EVENTS_GET
 possibleFixes: [ "Ensure the tool slug is correct and exists in the Composio project" ],
    errorId: "230babe4-e48c-4fb1-b96f-fce22a5e63ad",
       code: "TS-SDK::TOOL_NOT_FOUND"

Reproducibility

  • Always reproducible
  • Intermittent / Sometimes
  • Happened once, can’t reproduce

Additional Context or Screenshots

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions