( _error: unknown, defaultMessage: string, status = 500 )
| 61 | * Callers are responsible for logging the original error before calling this function. |
| 62 | */ |
| 63 | export function createMcpErrorResponse( |
| 64 | _error: unknown, |
| 65 | defaultMessage: string, |
| 66 | status = 500 |
| 67 | ): NextResponse { |
| 68 | const response: McpApiResponse = { |
| 69 | success: false, |
| 70 | error: defaultMessage, |
| 71 | } |
| 72 | |
| 73 | return NextResponse.json(response, { status }) |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Create standardized MCP success response |
no outgoing calls
no test coverage detected