{"record":{"id":"1b8eaa7c975b5729","repo":"ComposioHQ/composio","slug":"failed-to-parse-mcp-delete-response","errorCode":null,"errorMessage":"Failed to parse MCP delete response","messagePattern":"Failed to parse MCP delete response","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/utils/transformers/mcp.ts","lineNumber":114,"sourceCode":"      cause: result.error,\n    });\n  }\n\n  return result.data;\n}\n\n/**\n * Transform MCP delete response from snake_case to camelCase\n */\nexport function transformMcpDeleteResponse(response: McpDeleteResponseRaw): McpDeleteResponse {\n  const result = McpDeleteResponseSchema.safeParse({\n    id: (response as unknown as Record<string, unknown>).id,\n    deleted: (response as unknown as Record<string, unknown>).deleted,\n    message: (response as unknown as Record<string, unknown>).message,\n  });\n\n  if (!result.success) {\n    throw new ValidationError('Failed to parse MCP delete response', {\n      cause: result.error,\n    });\n  }\n\n  return result.data;\n}\n\n/**\n * Transform MCP update response from snake_case to camelCase\n */\nexport function transformMcpUpdateResponse(response: McpUpdateResponseRaw): McpUpdateResponse {\n  const result = McpUpdateResponseSchema.safeParse({\n    id: response.id,\n    name: response.name,\n    createdAt: response.created_at,\n    updatedAt: response.updated_at,\n    status: (response as unknown as Record<string, unknown>).status,\n    toolkits: response.toolkits,","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/utils/transformers/mcp.ts#L96-L132","documentation":"transformMcpDeleteResponse validates the delete confirmation (id, deleted, message) from the backend; if the shape does not parse, ValidationError is thrown with the Zod issues attached.","triggerScenarios":"Deleting an MCP server (composio.mcp.delete) where the response lacks or malforms id/deleted/message fields.","commonSituations":"Backend contract change; gateway returning an error body with 200; SDK/backend version mismatch.","solutions":["Upgrade @composio/core","Inspect error.cause to see which field failed","Check whether the server was actually deleted despite the parse failure (list again) before retrying, to avoid double-delete assumptions","Report with the raw response if on latest"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await composio.mcp.delete(id); } catch (e) { if (e instanceof ValidationError) { const stillThere = (await composio.mcp.list()).items.some(m => m.id === id); if (!stillThere) return; } throw e; }","preventionTips":["Treat delete parse failures as ambiguous — verify state before retrying","Log e.cause issues","Keep SDK current"],"tags":["mcp","validation","zod","delete"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}