fix: handle non-UUID id in get_mcp_gateway and related get tools#3222
Open
kevinpsj0 wants to merge 1 commit intoarchestra-ai:mainfrom
Open
fix: handle non-UUID id in get_mcp_gateway and related get tools#3222kevinpsj0 wants to merge 1 commit intoarchestra-ai:mainfrom
kevinpsj0 wants to merge 1 commit intoarchestra-ai:mainfrom
Conversation
When Claude passes a name string as the id parameter (e.g. 'n8n workflow: Grafana exporter'), PostgreSQL throws a cast error because the column expects a UUID. Instead of crashing, fall back to a name search when the id doesn't match UUID format. Fixes archestra-ai#3214
Collaborator
Author
|
Hi @iskhakov, we weren't able to provide a video demo because the quickstart environment requires additional MCP server configuration. The bug: When Claude calls archestra__get_mcp_gateway (or get_agent / get_llm_proxy) with a descriptive string as the id parameter, PostgreSQL throws a UUID cast error because the column expects a UUID. The fix: We added a UUID regex check before calling findById. If id doesn't match the UUID format, the handler falls back to the existing name-based search logic instead of crashing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When Claude calls archestra__get_mcp_gateway (or get_agent get_llm_proxy) with a descriptive name as the id parameter instead of a UUID, PostgreSQL throws a cast error and it surfaces as an unhandled crash.
As shown in #3214, Claude naturally tries id: 'n8n workflow: Grafana exporter' a valid human intent but not a UUID.
Fix
Added UUID format validation before calling indById. If the id parameter doesn't match UUID format, the handler now falls back to a name search (same logic as the existing
ame parameter path rather than crashing.
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
This fix applies to all three tools that share this handler: get_mcp_gateway, get_agent, and get_llm_proxy.
/claim #3214