diff --git a/apps/backend/src/lib/ai/tools/docs.ts b/apps/backend/src/lib/ai/tools/docs.ts index 79ddbd957..f03f90f7e 100644 --- a/apps/backend/src/lib/ai/tools/docs.ts +++ b/apps/backend/src/lib/ai/tools/docs.ts @@ -22,16 +22,16 @@ function getDocsToolsBaseUrl(): string { async function postDocsToolAction(action: Record): Promise { const base = getDocsToolsBaseUrl(); - - const res = await fetch(`${base}/api/internal/docs-tools`, { - method: "POST", - headers: { - "Content-Type": "application/json", - // MCP-style JSON-RPC endpoint requires clients to advertise both JSON and SSE. - Accept: "application/json, text/event-stream", - }, - body: JSON.stringify(action), - }); + try { + const res = await fetch(`${base}/api/internal/docs-tools`, { + method: "POST", + headers: { + "Content-Type": "application/json", + // MCP-style JSON-RPC endpoint requires clients to advertise both JSON and SSE. + Accept: "application/json, text/event-stream", + }, + body: JSON.stringify(action), + }); if (!res.ok) { const errBody = await res.text();