ComposioHQ/composio · error · ValidationError

Failed to parse MCP update response

Error message

Failed to parse MCP update response

What it means

transformMcpUpdateResponse validates the payload returned after updating an MCP server (status, toolkits, tools, etc.); parse failure throws ValidationError with the Zod cause.

Source

Thrown at ts/packages/core/src/utils/transformers/mcp.ts:137

  return result.data;
}

/**
 * Transform MCP update response from snake_case to camelCase
 */
export function transformMcpUpdateResponse(response: McpUpdateResponseRaw): McpUpdateResponse {
  const result = McpUpdateResponseSchema.safeParse({
    id: response.id,
    name: response.name,
    createdAt: response.created_at,
    updatedAt: response.updated_at,
    status: (response as unknown as Record<string, unknown>).status,
    toolkits: response.toolkits,
    tools: (response as unknown as Record<string, unknown>).tools,
  });

  if (!result.success) {
    throw new ValidationError('Failed to parse MCP update response', {
      cause: result.error,
    });
  }

  return result.data;
}

/**
 * Transform MCP generate URL response from snake_case to camelCase
 */
export function transformMcpGenerateUrlResponse(
  response: GenerateURLResponseRaw
): GenerateURLResponse {
  const result = GenerateURLResponseSchema.safeParse({
    connectedAccountUrls: response.connected_account_urls,
    userIdsUrl: response.user_ids_url,
    mcpUrl: response.mcp_url,
  });

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Upgrade @composio/core
  2. Inspect error.cause for the failing field and compare with what you passed
  3. Verify the update actually applied by retrieving the server before retrying
  4. Report the payload if the mismatch persists on latest
Defensive patterns

Strategy: try-catch

Try / catch

try { const updated = await composio.mcp.update(id, payload); } catch (e) { if (e instanceof ValidationError) { /* verify via mcp.get before retrying */ } throw e; }

Prevention

When it happens

Trigger: Updating an MCP server (composio.mcp.update) with toolkits/tools whose echoed-back shape fails the schema, e.g. unexpected tool entry format.

Common situations: Passing new/renamed toolkit identifiers that the backend echoes differently than the SDK expects; version skew; partially-updated server state.

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/a5cc7a752aeab627. Report an issue: GitHub.