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

Method execute

core/src/tools/mod.rs:455–472  ·  view source on GitHub ↗
(&self, name: &str, args: &serde_json::Value)

Source from the content-addressed store, hash-verified

453 }
454
455 pub async fn execute(&self, name: &str, args: &serde_json::Value) -> Result<ToolResult> {
456 let ctx = self.registry.context();
457 if let Err(e) = Self::check_workspace_boundary(name, args, &ctx) {
458 return Ok(ToolResult::error(name, e.to_string()));
459 }
460
461 log_tool_invocation(name, args);
462 self.capture_snapshot(name, args);
463 let mut result = self.registry.execute_with_context(name, args, &ctx).await;
464 if let Ok(ref mut r) = result {
465 self.attach_diff_metadata(name, args, r);
466 }
467 match &result {
468 Ok(r) => tracing::info!("Tool {} completed with exit_code={}", name, r.exit_code),
469 Err(e) => tracing::error!("Tool {} failed: {}", name, e),
470 }
471 result
472 }
473
474 pub async fn execute_with_context(
475 &self,

Calls 7

log_tool_invocationFunction · 0.85
contextMethod · 0.80
capture_snapshotMethod · 0.80
attach_diff_metadataMethod · 0.80
execute_with_contextMethod · 0.45
getMethod · 0.45
as_strMethod · 0.45