{"record":{"id":"0b1eef2b7050e642","repo":"ComposioHQ/composio","slug":"failed-to-parse-mcp-list-response","errorCode":null,"errorMessage":"Failed to parse MCP list response","messagePattern":"Failed to parse MCP list response","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/utils/transformers/mcp.ts","lineNumber":66,"sourceCode":"\n/**\n * Transform MCP list response from snake_case to camelCase\n */\nexport function transformMcpListResponse(response: McpListResponseRaw): McpListResponse {\n  const transformedItems = response.items?.map(item => ({\n    id: item.id,\n    name: item.name,\n    createdAt: item.created_at,\n    updatedAt: item.updated_at,\n    status: (item as unknown as Record<string, unknown>).status,\n  }));\n\n  const result = McpListResponseSchema.safeParse({\n    items: transformedItems,\n  });\n\n  if (!result.success) {\n    throw new ValidationError('Failed to parse MCP list response', {\n      cause: result.error,\n    });\n  }\n\n  return result.data;\n}\n\n/**\n * Transform MCP retrieve response from snake_case to camelCase\n */\nexport function transformMcpRetrieveResponse(\n  response: McpRetrieveResponseRaw\n): McpRetrieveResponse {\n  const result = McpRetrieveResponseSchema.safeParse({\n    id: response.id,\n    name: response.name,\n    createdAt: response.created_at,\n    updatedAt: response.updated_at,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/utils/transformers/mcp.ts#L48-L84","documentation":"transformMcpListResponse validates the transformed list of MCP servers against McpListResponseSchema; failure throws ValidationError with the Zod error as cause. It means at least one item in the MCP list response had an unexpected shape.","triggerScenarios":"Calling the MCP list endpoint (composio.mcp.list or equivalent) and receiving items whose fields fail the item schema after transformation to { items: [...] }.","commonSituations":"Backend adds/renames fields without the SDK's transformer knowing; partially-deleted or provisioning-state MCP servers with unusual payloads; SDK/backend version skew.","solutions":["Upgrade @composio/core to match the backend version","Inspect error.cause (ZodError issues) to identify the offending item and field","Retry after removing or waiting on the malformed/in-flight MCP server if it correlates with a provisioning entry","File an issue with the raw response payload if persistent on latest"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const list = await composio.mcp.list(); } catch (e) { if (e instanceof ValidationError) { /* inspect e.cause.issues, retry after cleanup */ } throw e; }","preventionTips":["Keep SDK and backend versions aligned","Wrap MCP list calls with error reporting that serializes e.cause","Treat single-item parse failures as data, not fatal: retry list after addressing the item"],"tags":["mcp","validation","zod","api-mismatch"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}