MCPcopy Create free account
hub / github.com/AI45Lab/Code / execute

Method execute

core/src/tools/program_tool.rs:97–112  ·  view source on GitHub ↗
(&self, args: &serde_json::Value, ctx: &ToolContext)

Source from the content-addressed store, hash-verified

95 }
96
97 async fn execute(&self, args: &serde_json::Value, ctx: &ToolContext) -> Result<ToolOutput> {
98 let Some(kind) = args.get("type").and_then(|value| value.as_str()) else {
99 return Ok(ToolOutput::error("type parameter is required"));
100 };
101 if kind != "script" {
102 return Ok(ToolOutput::error(format!(
103 "Unsupported program type: {kind}. Only \"script\" is supported."
104 )));
105 }
106 let inputs = args
107 .get("inputs")
108 .cloned()
109 .unwrap_or_else(|| serde_json::json!({}));
110
111 execute_script_program(args, inputs, Arc::clone(&self.registry), ctx).await
112 }
113}
114
115#[derive(Debug, Deserialize)]

Calls 3

execute_script_programFunction · 0.85
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected