MCPcopy Index your code
hub / github.com/enowdev/enowX-Coder / execute

Method execute

src-tauri/src/tools/executor.rs:185–209  ·  view source on GitHub ↗
(&self, call: ToolCall)

Source from the content-addressed store, hash-verified

183 }
184
185 pub async fn execute(&self, call: ToolCall) -> ToolResult {
186 let tool = call.tool;
187 let result = match tool {
188 ToolName::ReadFile => self.read_file(&call.input).await,
189 ToolName::WriteFile => self.write_file(&call.input).await,
190 ToolName::PatchFile => self.patch_file(&call.input).await,
191 ToolName::ListDir => self.list_dir(&call.input).await,
192 ToolName::SearchFiles => self.search_files(&call.input).await,
193 ToolName::RunCommand => self.run_command(&call.input).await,
194 ToolName::WebSearch => self.web_search(&call.input).await,
195 };
196
197 match result {
198 Ok(output) => ToolResult {
199 tool,
200 output,
201 is_error: false,
202 },
203 Err(error) => ToolResult {
204 tool,
205 output: error.to_string(),
206 is_error: true,
207 },
208 }
209 }
210
211 async fn read_file(&self, input: &serde_json::Value) -> AppResult<String> {
212 let path_str = input["path"]

Calls 7

read_fileMethod · 0.80
write_fileMethod · 0.80
patch_fileMethod · 0.80
list_dirMethod · 0.80
search_filesMethod · 0.80
run_commandMethod · 0.80
web_searchMethod · 0.80