fix(mcp): map validation and conflict orchestration errors to 400/409#4628
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Workflow MCP server routes ( Reviewed by Cursor Bugbot for commit c81b3ea. Configure here. |
Greptile SummaryThis PR fixes incorrect HTTP status codes for MCP orchestration errors by adding
Confidence Score: 5/5Safe to merge — the three migrated routes have equivalent or improved status-code behaviour and no existing error path regresses. The change is a narrow, well-scoped fix: two new branches in a pure mapping function and three call-site migrations. All currently emitted error codes map to the same HTTP statuses as before. The only unmigrated file already produces correct statuses with its own inline logic. apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts — PATCH and DELETE handlers still use inline ternaries instead of mcpOrchestrationStatus. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Workflow-server route error] --> B[mcpOrchestrationStatus]
B --> C{errorCode?}
C -->|validation| D[400 Bad Request]
C -->|forbidden| E[403 Forbidden]
C -->|not_found| F[404 Not Found]
C -->|conflict| G[409 Conflict]
C -->|bad_gateway| H[502 Bad Gateway]
C -->|internal / undefined| I[500 Internal Server Error]
Reviews (2): Last reviewed commit: "fix(mcp): migrate workflow-server routes..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c81b3ea. Configure here.
Summary
mcpOrchestrationStatuswas missingvalidationandconflicterror codes, defaulting both to 500validationnow maps to 400,conflictto 409 — matching how workflow MCP server routes handle these codesType of Change
Testing
Tested manually
Checklist