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

Method attach_diff_metadata

core/src/tools/mod.rs:494–505  ·  view source on GitHub ↗
(&self, name: &str, args: &serde_json::Value, result: &mut ToolResult)

Source from the content-addressed store, hash-verified

492 }
493
494 fn attach_diff_metadata(&self, name: &str, args: &serde_json::Value, result: &mut ToolResult) {
495 if !file_history::is_file_modifying_tool(name) {
496 return;
497 }
498 let Some(file_path) = file_history::extract_file_path(name, args) else {
499 return;
500 };
501 // Only store file_path in metadata, let translate_event read the actual content
502 // using the session's correct workspace
503 let meta = result.metadata.get_or_insert_with(|| serde_json::json!({}));
504 meta["file_path"] = serde_json::Value::String(file_path);
505 }
506
507 pub fn definitions(&self) -> Vec<ToolDefinition> {
508 self.registry.definitions()

Callers 2

executeMethod · 0.80
execute_with_contextMethod · 0.80

Calls 2

is_file_modifying_toolFunction · 0.85
extract_file_pathFunction · 0.85

Tested by

no test coverage detected