Skip to content

One contract, one 422

Resolving from anywhereDashboardHTTPSDKCLIMCPenforce_schemaschema_validationisValidationErrorBody

Every resolve surface rejects a bad payload with the same 422 body naming each field, so every client handles validation one way.

The situation

The same role is resolved by the dashboard, a webhook, an agent and a script. Each would otherwise invent its own error handling for a missing field or a wrong type.

The recipe

422 from any surface
{
"error": "resolverPayload failed schema validation (2 violations)",
"code": "schema_validation",
"violations": [
{ "field": "contact_email", "message": "Enter a valid email address" },
{ "field": "tier", "message": "Must be one of: free, starter, professional, enterprise" }
],
"role": "intake-reviewer",
"schemaVersion": 3
}
Surface How it arrives
HTTP The 422 response body
SDK result.status === 422, body in result.data, narrow with isValidationErrorBody
MCP The same JSON with isError: true
CLI Each violation printed beneath the error line
Dashboard Mapped into the form’s errors panel

The guarantee

Validation runs before any state changes. The dashboard’s pre-submit check and the server gate are one shared module, so a payload that passes the panel passes the server. Bulk surfaces tag each violation with its escalationId, and one failing item blocks the batch. See Schema enforcement.