pub struct ToolCallRequest {
pub name: String,
pub arguments: Value,
pub tool_call_id: Option<String>,
pub progress_token: Option<Value>,
pub call_key: Option<String>,
pub schema_pin: Option<String>,
pub preset: Option<String>,
pub origin: Option<CallOrigin>,
pub output_refs: Option<OutputRefs>,
}Expand description
A tool invocation as carried on a route REQUEST frame.
Fields§
§name: StringThe provider’s bare manifest tool name (no gateway prefix).
arguments: ValueThe arguments exactly as the caller supplied them; consumers never translate them, and the provider’s manifest schema is what accepts or rejects their shape.
tool_call_id: Option<String>The consumer’s own identifier for this call, minted by whatever dispatched it (a model runner’s WAL intent id, a gateway request id). Opaque to the daemon and to subc; unique per call on the consumer’s side, so a provider’s at-most-once fence can key on it directly instead of synthesizing an id from the call’s contents.
None is a statement about the PRODUCER, not the call: it means this
consumer did not supply an id, never that the call has no identity.
A reader must not collapse the two — the moment a legacy producer is
on the other end, treating None as “no id exists” and synthesizing
one silently reproduces exactly the failure this field exists to end.
A reader that synthesizes a fallback id when this is None must
record that the fallback fired (a fallback that never reports firing
is indistinguishable from a working component that is quietly wrong).
progress_token: Option<Value>An MCP progress token the consumer wants progress notifications correlated to, when the caller requested progress. Opaque here.
call_key: Option<String>A key the consumer chose for this call, which a provider may use to
recognise the same call arriving twice. Opaque to the daemon; a
provider checks only its shape, with validate_call_key, and answers
a malformed one with invalid_request naming the field
CALL_KEY_FIELD.
This struct is deliberately not #[non_exhaustive]: a consumer that
builds it field by field must decide what key, if any, to send, so a
new field here is meant to stop its struct literal compiling.
schema_pin: Option<String>Which version of the tool’s schema the consumer built its arguments
against, so a provider can tell a call made against a schema it no
longer serves. Opaque here: the tool-provider role defines what it
holds. A provider checks only its shape, with validate_schema_pin,
and answers a malformed one with invalid_request naming the field
SCHEMA_PIN_FIELD.
preset: Option<String>The session’s tool preset, assigned by the module that owns the session
and forwarded by its carrier on every call, outside the model’s
arguments. Opaque to the
daemon. A provider checks its shape with validate_preset and answers
a malformed value with invalid_request naming PRESET_FIELD.
Absent means the caller did not say: a provider must decide explicitly what an absent preset gets, and must not default it to the most capable preset. A provider refuses a preset it does not serve, by name, rather than falling back to a default.
origin: Option<CallOrigin>The caller behind this call when the consumer is relaying it for
someone else; None when the consumer is the caller. For attribution
only, never authority: see CallOrigin. A provider checks it with
validate_call_origin.
output_refs: Option<OutputRefs>The llm-runner’s output-refs descriptor for this call: which stored set
of tool-output snapshots the agent’s references resolved to, so the
provider can read those snapshots back from the runner. See
OutputRefs for what this crate checks and what it leaves to the
llm-runner contract.
It sits beside the arguments, never inside them, so the model cannot
write it. A runner attaches it only to a call whose provider declares
output_refs: true; None means the runner sent no descriptor, and the
member is then left out of the encoding. The daemon never reads it.