Skip to main content

ToolCallAuthRequiredState

Struct ToolCallAuthRequiredState 

Source
pub struct ToolCallAuthRequiredState {
Show 13 fields pub tool_call_id: String, pub tool_name: String, pub display_name: String, pub intention: Option<String>, pub contributor: Option<ToolCallContributor>, pub meta: Option<JsonObject>, pub invocation_message: StringOrMarkdown, pub tool_input: Option<ToolInput>, pub confirmed: ToolCallConfirmationReason, pub selected_option: Option<ConfirmationOption>, pub status: ToolCallStatus, pub auth: McpAuthRequirement, pub content: Option<Vec<ToolResultContent>>,
}
Expand description

A running tool call is paused because the MCP server backing it needs authentication — most commonly {@link McpAuthRequirement.reason | insufficientScope} step-up auth triggered by the tools/call request itself. Only ever reached from {@link ToolCallRunningState}, and normally returns there once authenticated: runningauth-requiredrunning → …. A client MAY instead cancel the invocation without authenticating by dispatching a chat/toolCallComplete with a failed result, always moving straight to {@link ToolCallCompletedState} — requiresResultConfirmation is ignored on this path, so it can never enter {@link ToolCallPendingResultConfirmationState}. A successful result dispatched from this state is invalid and MUST be rejected/ignored as a no-op by the reducer, since execution never resumed after the challenge.

This is the tool-call-level counterpart to {@link McpServerAuthRequiredState} — that state means the MCP server cannot serve any request; this one means this specific invocation is waiting on the same kind of challenge. The two are dispatched independently and MAY be true at the same time, or not: an insufficientScope challenge triggered by a single tool call, for example, need not block the whole server.

Because the challenge is always resolved by pushing a token via the existing authenticate command, this state can only originate from a tool call {@link ToolCallContributorKind.MCP | contributed by an MCP server} — contributor is narrowed accordingly (unlike the optional, multi-kind contributor on other tool call states).

Fields§

§tool_call_id: String

Unique tool call identifier

§tool_name: String

Internal tool name (for debugging/logging)

§display_name: String

Human-readable tool name

§intention: Option<String>

Human-readable description of what the tool invocation intends to do

§contributor: Option<ToolCallContributor>

Reference to the contributor of the tool being called.

§meta: Option<JsonObject>

Additional provider-specific metadata for this tool call.

This MAY include a ui field corresponding to the MCP Apps (SEP-1865) McpUiToolMeta found in MCP tool calls, which may be used in combination with the {@link contributor} to serve MCP Apps.

§invocation_message: StringOrMarkdown

Message describing what the tool will do

§tool_input: Option<ToolInput>

Final tool input.

Referenced input is mutable until the tool call leaves pending-confirmation. When the client confirms with editedToolInput, the host MUST replace the resource contents before echoing the accepted confirmation action. Clients MUST NOT cache tool input across confirmation.

§confirmed: ToolCallConfirmationReason

How the tool was confirmed for execution

§selected_option: Option<ConfirmationOption>

The confirmation option the user selected, if confirmation options were provided

§status: ToolCallStatus§auth: McpAuthRequirement

The authentication challenge blocking this invocation.

§content: Option<Vec<ToolResultContent>>

Partial content produced before the call paused for authentication.

Trait Implementations§

Source§

impl Clone for ToolCallAuthRequiredState

Source§

fn clone(&self) -> ToolCallAuthRequiredState

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 ToolCallAuthRequiredState

Source§

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

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

impl<'de> Deserialize<'de> for ToolCallAuthRequiredState

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 ToolCallAuthRequiredState

Source§

fn eq(&self, other: &ToolCallAuthRequiredState) -> 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 ToolCallAuthRequiredState

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 ToolCallAuthRequiredState

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.