Wymcp. Plugs. Validate
(Wymcp v0.1.1)
View Source
Message validation: checks the parsed body against the era's compiled
protocol schema (Wymcp.JsonRpc.validate_mcp_request/2) and answers a
non-conforming message with HTTP 400 plus -32600, carrying the original
request and the validator's distilled error — a one-line message plus one
entry per instance location — under data. This body's reader is the human
debugging a client rather than an LLM, since no LLM authors a JSON-RPC
message, so it keeps per-location detail where the tool-arguments path is
tuned for a next action.
Two message kinds bypass validation, each because validating it could only produce an answer the protocol forbids:
- a JSON-RPC response — a client's answer to a server-initiated request.
It is not a protocol request at all, and
Wymcp.Plugs.Dispatchdelivers it to the session that minted its id. - a modern-lane notification —
Wymcp.Plugs.Dispatchanswers it 202 and drops it whatever its body, and JSON-RPC forbids an error response to a notification.
An unset era assign reads :legacy: era classification exists only on the
POST pipeline, and the default lane for a signal-less request is the legacy
one.