#[non_exhaustive]pub struct CanUseToolRequest {Show 18 fields
pub tool_name: String,
pub input: Value,
pub tool_use_id: Option<String>,
pub permission_suggestions: Option<Vec<Value>>,
pub decision_reason: Option<String>,
pub decision_reason_type: Option<String>,
pub mcp_server: Option<Value>,
pub blocked_path: Option<String>,
pub classifier_approvable: Option<bool>,
pub suppress_always_allow_rule: Option<bool>,
pub default_to_no: Option<bool>,
pub matched_ask_rule: Option<Value>,
pub title: Option<String>,
pub display_name: Option<String>,
pub description: Option<String>,
pub agent_id: Option<String>,
pub requires_user_interaction: Option<bool>,
pub extra: HashMap<String, Value>,
}Expand description
Source: binary can_use_tool schema; query.py:244–262
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tool_name: StringTool the model wants to use.
input: ValueTool input.
tool_use_id: Option<String>Tool-use id of the call.
permission_suggestions: Option<Vec<Value>>Permission updates that would stop the CLI asking again; return them
with ToolDecision::allow_and_remember for “always allow”.
decision_reason: Option<String>Human-readable reason the CLI asks; may carry ANSI escapes.
decision_reason_type: Option<String>Why the ask escalated: “rule”, “hook”, “safetyCheck”, “classifier”, …
mcp_server: Option<Value>MCP server of the tool: {"name", "source"}.
blocked_path: Option<String>Path outside the allowed directories that triggered the ask.
classifier_approvable: Option<bool>Set when a safety check is involved: false = one needs manual approval.
suppress_always_allow_rule: Option<bool>Do not offer “always allow” for this ask.
default_to_no: Option<bool>The ask must not be approvable by a single stray keystroke.
matched_ask_rule: Option<Value>User permissions.ask rule that forced this prompt: {source, tool_name, rule_content}.
title: Option<String>Permission-display title.
display_name: Option<String>Short tool or server label for display.
description: Option<String>Permission-display subtitle.
agent_id: Option<String>Subagent that wants to use the tool.
requires_user_interaction: Option<bool>One-tap Approve/Deny must not be offered.
extra: HashMap<String, Value>Fields not named above.