pub fn require_confirmation_if_destructive(
action: &str,
params: &Value,
) -> Result<(), Box<ToolError>>Expand description
Confirmation gate for destructive actions, shared by every surface.
Returns Err with a structured validation error when action is marked
destructive in ACTION_SPECS and the caller did not pass
"confirm": true in params. Non-destructive actions (and unknown actions,
which fail later in scope/dispatch) always pass. Cheap and side-effect free —
call it on every dispatch so a future destructive action is gated by default
rather than by remembering to add a check.