ComposioHQ/composio · error · ValidationError
Failed to parse MCP delete response
Error message
Failed to parse MCP delete response
What it means
transformMcpDeleteResponse validates the delete confirmation (id, deleted, message) from the backend; if the shape does not parse, ValidationError is thrown with the Zod issues attached.
Source
Thrown at ts/packages/core/src/utils/transformers/mcp.ts:114
cause: result.error,
});
}
return result.data;
}
/**
* Transform MCP delete response from snake_case to camelCase
*/
export function transformMcpDeleteResponse(response: McpDeleteResponseRaw): McpDeleteResponse {
const result = McpDeleteResponseSchema.safeParse({
id: (response as unknown as Record<string, unknown>).id,
deleted: (response as unknown as Record<string, unknown>).deleted,
message: (response as unknown as Record<string, unknown>).message,
});
if (!result.success) {
throw new ValidationError('Failed to parse MCP delete response', {
cause: result.error,
});
}
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,View on GitHub (pinned to 64b1b85502)
Solutions
- Upgrade @composio/core
- Inspect error.cause to see which field failed
- Check whether the server was actually deleted despite the parse failure (list again) before retrying, to avoid double-delete assumptions
- Report with the raw response if on latest
Defensive patterns
Strategy: try-catch
Try / catch
try { await composio.mcp.delete(id); } catch (e) { if (e instanceof ValidationError) { const stillThere = (await composio.mcp.list()).items.some(m => m.id === id); if (!stillThere) return; } throw e; } Prevention
- Treat delete parse failures as ambiguous — verify state before retrying
- Log e.cause issues
- Keep SDK current
When it happens
Trigger: Deleting an MCP server (composio.mcp.delete) where the response lacks or malforms id/deleted/message fields.
Common situations: Backend contract change; gateway returning an error body with 200; SDK/backend version mismatch.
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 tool router session files mount delete optio
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/1b8eaa7c975b5729.
Report an issue: GitHub.