ComposioHQ/composio · error · ValidationError
Failed to parse MCP list response
Error message
Failed to parse MCP list response
What it means
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.
Source
Thrown at ts/packages/core/src/utils/transformers/mcp.ts:66
/**
* Transform MCP list response from snake_case to camelCase
*/
export function transformMcpListResponse(response: McpListResponseRaw): McpListResponse {
const transformedItems = response.items?.map(item => ({
id: item.id,
name: item.name,
createdAt: item.created_at,
updatedAt: item.updated_at,
status: (item as unknown as Record<string, unknown>).status,
}));
const result = McpListResponseSchema.safeParse({
items: transformedItems,
});
if (!result.success) {
throw new ValidationError('Failed to parse MCP list response', {
cause: result.error,
});
}
return result.data;
}
/**
* Transform MCP retrieve response from snake_case to camelCase
*/
export function transformMcpRetrieveResponse(
response: McpRetrieveResponseRaw
): McpRetrieveResponse {
const result = McpRetrieveResponseSchema.safeParse({
id: response.id,
name: response.name,
createdAt: response.created_at,
updatedAt: response.updated_at,View on GitHub (pinned to 64b1b85502)
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
Defensive patterns
Strategy: try-catch
Try / catch
try { const list = await composio.mcp.list(); } catch (e) { if (e instanceof ValidationError) { /* inspect e.cause.issues, retry after cleanup */ } throw e; } Prevention
- 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
When it happens
Trigger: Calling the MCP list endpoint (composio.mcp.list or equivalent) and receiving items whose fields fail the item schema after transformation to { items: [...] }.
Common situations: Backend adds/renames fields without the SDK's transformer knowing; partially-deleted or provisioning-state MCP servers with unusual payloads; SDK/backend version skew.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Failed to parse MCP create response
- Failed to parse MCP retrieve response
- Invalid parameters passed to create mcp config
- Failed to validate list options
- Failed to validate update params
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/0b1eef2b7050e642.
Report an issue: GitHub.