Skip to main content

Module tool_call

Module tool_call 

Source
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§

ToolCallRequest
A tool invocation as carried on a route REQUEST frame.

Enums§

OpaqueFieldError
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 its invalid_request error without tracking which check ran.

Constants§

CALL_KEY_FIELD
The wire name of ToolCallRequest::call_key, for the field of the invalid_request error a provider returns when the key is malformed.
CALL_KEY_MAX_LEN
The longest call_key accepted.
OPAQUE_FIELD_MAX_LEN
The longest opaque token field accepted, in bytes (every accepted byte is one ASCII character). Shared by call_key and schema_pin.
SCHEMA_PIN_FIELD
The wire name of ToolCallRequest::schema_pin, for the field of the invalid_request error a provider returns when the pin is malformed.
SCHEMA_PIN_MAX_LEN
The longest schema_pin accepted.

Functions§

validate_call_key
Check a call_key with the shared opaque-field rule; errors name CALL_KEY_FIELD.
validate_schema_pin
Check a schema_pin with the shared opaque-field rule; errors name SCHEMA_PIN_FIELD.

Type Aliases§

CallKeyError
The error validate_call_key returns. Kept as a name so code that only formats the error or reads OpaqueFieldError::field keeps compiling.