ComposioHQ/composio · error · ValidationError

Failed to parse MCP generate URL response

Error message

Failed to parse MCP generate URL response

What it means

transformMcpGenerateUrlResponse validates the generated MCP connection URLs (connectedAccountUrls, userIdsUrl, mcpUrl); failure throws ValidationError with the Zod parse error as cause.

Source

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

  }

  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,
  });

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

  return result.data;
}

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Upgrade @composio/core
  2. Inspect error.cause to identify the missing/malformed URL field
  3. Ensure the request included valid toolkits/connected-account parameters
  4. Report with the raw response if on latest
Defensive patterns

Strategy: try-catch

Try / catch

try { const urls = await composio.mcp.generateUrl(/* ... */); } catch (e) { if (e instanceof ValidationError) { /* inspect e.cause for missing URL field */ } throw e; }

Prevention

When it happens

Trigger: Generating MCP URLs (e.g. composio.mcp.generateUrl / getMcpUrl flows) when the backend response omits or malforms connected_account_urls, user_ids_url, or mcp_url.

Common situations: Backend contract change; no connected accounts/user ids in scope returning a different envelope; SDK behind backend version.

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