MCPcopy Index your code
hub / github.com/AI45Lab/Code / confirm_tool_use

Method confirm_tool_use

sdk/python/src/lib.rs:2420–2432  ·  view source on GitHub ↗
(
        &self,
        py: Python<'_>,
        tool_id: String,
        approved: bool,
        reason: Option<String>,
    )

Source from the content-addressed store, hash-verified

2418 /// Resolve a pending HITL tool confirmation.
2419 #[pyo3(signature = (tool_id, approved, reason=None))]
2420 fn confirm_tool_use(
2421 &self,
2422 py: Python<'_>,
2423 tool_id: String,
2424 approved: bool,
2425 reason: Option<String>,
2426 ) -> PyResult<bool> {
2427 let session = self.inner.clone();
2428 py.allow_threads(move || {
2429 get_runtime().block_on(session.confirm_tool_use(&tool_id, approved, reason))
2430 })
2431 .map_err(|e| PyRuntimeError::new_err(format!("confirm_tool_use failed: {e}")))
2432 }
2433
2434 /// Cancel all pending HITL confirmations for this session.
2435 fn cancel_confirmations(&self, py: Python<'_>) -> usize {

Callers 1

confirm_from_cliFunction · 0.45

Calls 3

block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected