(errorCode: string | undefined)
| 89 | * Maps MCP orchestration error codes to safe HTTP statuses. |
| 90 | */ |
| 91 | export function mcpOrchestrationStatus(errorCode: string | undefined): number { |
| 92 | if (errorCode === 'validation') return 400 |
| 93 | if (errorCode === 'forbidden') return 403 |
| 94 | if (errorCode === 'not_found') return 404 |
| 95 | if (errorCode === 'conflict') return 409 |
| 96 | if (errorCode === 'bad_gateway') return 502 |
| 97 | return 500 |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Validate string parameter |