Expand description
The body of a tool-call REQUEST frame on a bound route.
The daemon splices route frames without reading their bodies, so this
shape is a contract between consumers (the MCP gateway, model runners)
and provider modules, not something the daemon enforces. Before this
type existed every consumer carried its own struct and every provider its
own reader, and the fields drifted: the gateway sent progress_token,
a model runner sent only name and arguments, and a provider that
needed the caller’s tool-call id had no field to read it from.
Decoding is deliberately tolerant of unknown members: a provider must
never refuse a call because a newer consumer added a key it does not
know. Omitted optionals decode as None; None optionals are omitted on
the wire, so a body carrying neither optional serializes exactly as the
two-field shape older consumers already send — this type is drop-in for
them without a wire change.
Structs§
- Tool
Call Request - A tool invocation as carried on a route
REQUESTframe.
Enums§
- Opaque
Field Error - Why an opaque token field (
call_key,schema_pin) was refused. Every variant names the request field it is about, so a provider can put it in itsinvalid_requesterror without tracking which check ran.
Constants§
- CALL_
KEY_ FIELD - The wire name of
ToolCallRequest::call_key, for thefieldof theinvalid_requesterror a provider returns when the key is malformed. - CALL_
KEY_ MAX_ LEN - The longest
call_keyaccepted. - OPAQUE_
FIELD_ MAX_ LEN - The longest opaque token field accepted, in bytes (every accepted byte is
one ASCII character). Shared by
call_keyandschema_pin. - SCHEMA_
PIN_ FIELD - The wire name of
ToolCallRequest::schema_pin, for thefieldof theinvalid_requesterror a provider returns when the pin is malformed. - SCHEMA_
PIN_ MAX_ LEN - The longest
schema_pinaccepted.
Functions§
- validate_
call_ key - Check a
call_keywith the shared opaque-field rule; errors nameCALL_KEY_FIELD. - validate_
schema_ pin - Check a
schema_pinwith the shared opaque-field rule; errors nameSCHEMA_PIN_FIELD.
Type Aliases§
- Call
KeyError - The error
validate_call_keyreturns. Kept as a name so code that only formats the error or readsOpaqueFieldError::fieldkeeps compiling.