What they are for
Intermediaries — gateways, routers — read headers without opening the body. A tool can therefore declare that one of its parameters belongs in a header, and the specification also requires a header naming the server on certain methods.
Only along a direct chain of properties
If it sits under an array's items, or under a construct that could take one of several shapes, there is no single path to read in the arguments — so there is no way to know which value to put in the header. The specification calls such a tool invalid, and it is rejected with that reason rather than guessed at.
What a header value may contain
| Value | Sent as |
|---|---|
| Plain visible ASCII, no surrounding spaces | itself |
| Anything else — accents, newlines, control characters | encoded behind the sentinel the specification defines |
| Plain ASCII that looks like the sentinel | encoded too |
The last row is the subtle one: a value that already resembles the encoding marker would be decoded by the server into something other than what the body carries — exactly the mismatch the protocol has an error code for.
A mismatch is reported precisely
A modern server answering that the header does not match the body is saying something specific. It is not a reason to retry with an older handshake, which would replace the real cause with a different one.
If you call the client yourself
Pass the tool's recorded schema to call(). Without it an annotated argument stays in the body and the server refuses. api.mcp.call() does this for you.