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
- Upgrade @composio/core
- Inspect error.cause for the failing field and compare with what you passed
- Verify the update actually applied by retrieving the server before retrying
- 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
- Confirm update semantics are idempotent before retrying
- Compare echoed payload vs request on parse failure
- Stay on latest SDK
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.
- 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/a5cc7a752aeab627.
Report an issue: GitHub.