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

Function extract_file_path

core/src/file_history.rs:151–159  ·  view source on GitHub ↗

Extract the file path from tool arguments for file-modifying tools

(tool_name: &str, args: &serde_json::Value)

Source from the content-addressed store, hash-verified

149
150/// Extract the file path from tool arguments for file-modifying tools
151pub fn extract_file_path(tool_name: &str, args: &serde_json::Value) -> Option<String> {
152 if is_file_modifying_tool(tool_name) {
153 args.get("file_path")
154 .and_then(|v| v.as_str())
155 .map(|s| s.to_string())
156 } else {
157 None
158 }
159}
160
161#[cfg(test)]
162mod tests {

Callers 2

capture_snapshotMethod · 0.85
attach_diff_metadataMethod · 0.85

Calls 3

is_file_modifying_toolFunction · 0.85
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected