Skip to content

Commit 961aa12

Browse files
committed
update error codes
1 parent ca2150c commit 961aa12

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { NextRequest } from 'next/server'
21
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
32
import {
43
copilotMcpDeprecatedJsonRpcResponse,
@@ -9,9 +8,6 @@ export const dynamic = 'force-dynamic'
98

109
export const GET = withRouteHandler(async () => copilotMcpDeprecatedResponse())
1110

12-
export const POST = withRouteHandler(async (request: NextRequest) => {
13-
void request
14-
return copilotMcpDeprecatedJsonRpcResponse()
15-
})
11+
export const POST = withRouteHandler(async () => copilotMcpDeprecatedJsonRpcResponse())
1612

1713
export const DELETE = withRouteHandler(async () => copilotMcpDeprecatedJsonRpcResponse())

apps/sim/lib/mcp/copilot-deprecated.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { RequestId } from '@modelcontextprotocol/sdk/types.js'
21
import { NextResponse } from 'next/server'
32

43
const DEPRECATION_MESSAGE = 'Copilot MCP has been deprecated and is no longer available.'
@@ -21,12 +20,12 @@ export function copilotMcpDeprecatedResponse(): NextResponse {
2120
* JSON-RPC flavored 410 response for the deprecated Copilot MCP `POST` endpoint,
2221
* so MCP clients surface a clean error envelope instead of an opaque body.
2322
*/
24-
export function copilotMcpDeprecatedJsonRpcResponse(id: RequestId = 0): NextResponse {
23+
export function copilotMcpDeprecatedJsonRpcResponse(): NextResponse {
2524
return NextResponse.json(
2625
{
2726
jsonrpc: '2.0',
28-
id,
29-
error: { code: -32601, message: DEPRECATION_MESSAGE },
27+
id: null,
28+
error: { code: -32000, message: DEPRECATION_MESSAGE },
3029
},
3130
{
3231
status: 410,

0 commit comments

Comments
 (0)