@devries-cameron20 / composio-1 / commits / 38899bdfa
Fork 0

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: use Tool Router schemas for custom MCP search (#4185)

## What this fixes A custom MCP toolkit registered from the consumer dashboard could appear in the dashboard/Tool Router but not in `composio search`. The CLI was receiving the custom toolkit from Tool Router search, then trying to fetch its schema through the legacy `/api/v3/tools/{slug}` endpoint. That endpoint does not serve dashboard-owned `CUSTOM_*` toolkits, so it returned 404 and the CLI could not complete the search result. ## How it fixes it - For remote `CUSTOM_*` toolkit slugs with an inline `input_schema`, the CLI uses the schema already returned by Tool Router search. - For `CUSTOM_*` results that contain only a `schemaRef`, the CLI calls Tool Router's `COMPOSIO_GET_TOOL_SCHEMAS` meta-tool in the same session and uses the returned schema. - Both paths store the schema through the existing local tool-definition cache path, so normal execution can use it. - Managed Composio toolkits keep the existing schema-fetch path. - Existing cache behavior is unchanged. ## Reproduction We reproduced this against a production dashboard-created DeepWiki custom MCP: - Before the fix, a cold-cache CLI search reached the custom toolkit but failed on the legacy schema lookup with 404. - With the fix, unfiltered `composio search` returned the custom MCP tools. - Executing the returned custom tool succeeded and returned the DeepWiki response. - Regression coverage also verifies the schema-reference path does not use the legacy endpoint. ## Scope This fixes the `composio search` → normal execute path for dashboard-created custom MCP toolkits. This PR does not change: - CLI cache TTLs or refresh behavior - Dashboard-to-CLI cache invalidation - The separate schema paths used by `composio tools info` or `composio execute --dry-run` ## Validation - Focused CLI tests: 21 passed - Full CLI test suite: 1,256 passed, 1 skipped - Source and test typechecks passed - Focused Oxlint passed - Production reproduction passed

shams haroon committed Aug 20, 2026 at 18:22 UTC 38899bdfa02fe10d9df65d230a67f9f5df987420

No changes.