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

  1. Upgrade @composio/core to match the backend version
  2. Inspect error.cause (ZodError issues) to identify the offending item and field
  3. Retry after removing or waiting on the malformed/in-flight MCP server if it correlates with a provisioning entry
  4. 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

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.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/0b1eef2b7050e642. Report an issue: GitHub.