MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / record_tool_execution

Method record_tool_execution

python/src/tools/registry.rs:387–400  ·  view source on GitHub ↗

Record tool execution in metadata (internal method)

(&self, name: &str, duration_ms: u64)

Source from the content-addressed store, hash-verified

385impl ToolRegistry {
386 /// Record tool execution in metadata (internal method)
387 fn record_tool_execution(&self, name: &str, duration_ms: u64) -> PyResult<()> {
388 let mut metadata = self.metadata.write().map_err(|e| {
389 PyErr::new::<pyo3::exceptions::PyRuntimeError, _>(format!(
390 "Failed to acquire metadata lock: {}",
391 e
392 ))
393 })?;
394
395 if let Some(meta) = metadata.get_mut(name) {
396 meta.record_call(duration_ms);
397 }
398
399 Ok(())
400 }
401
402 /// Add result to execution history (internal method)
403 fn add_to_history(&self, result: ToolResult) -> PyResult<()> {

Callers 2

execute_toolMethod · 0.80

Calls 1

record_callMethod · 0.80

Tested by 1