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: running → auth-required → running
→ …. 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: StringUnique tool call identifier
tool_name: StringInternal tool name (for debugging/logging)
display_name: StringHuman-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: StringOrMarkdownMessage 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: ToolCallConfirmationReasonHow the tool was confirmed for execution
selected_option: Option<ConfirmationOption>The confirmation option the user selected, if confirmation options were provided
status: ToolCallStatus§auth: McpAuthRequirementThe 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
impl Clone for ToolCallAuthRequiredState
Source§fn clone(&self) -> ToolCallAuthRequiredState
fn clone(&self) -> ToolCallAuthRequiredState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more