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
- Upgrade @composio/core
- Inspect error.cause to identify the missing/malformed URL field
- Ensure the request included valid toolkits/connected-account parameters
- 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
- Pass valid toolkits/connected-account parameters when generating URLs
- Upgrade SDK when backend URL endpoints change
- Log the failing field from ZodError issues
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.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Invalid parameters passed to create mcp config
- Failed to validate list options
- Failed to validate update params
- Invalid params passed for Get Instance Params
- Failed to parse MCP create response
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/5769a224ed4481a4.
Report an issue: GitHub.