Skip to main content

ToolCallRequest

Struct ToolCallRequest 

Source
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: String

The provider’s bare manifest tool name (no gateway prefix).

§arguments: Value

The 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.

Implementations§

Source§

impl ToolCallRequest

Source

pub fn new(name: impl Into<String>, arguments: Value) -> Self

A call with no consumer id, no progress token, no call key, no schema pin, no preset, no origin and no output refs — the shape older two-field consumers send.

Trait Implementations§

Source§

impl Clone for ToolCallRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ToolCallRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ToolCallRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ToolCallRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ToolCallRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ToolCallRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ToolCallRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.