MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / extract_file_path

Function extract_file_path

atomic-agent/src/hooks/grok.rs:412–420  ·  view source on GitHub ↗
(tool_input: Option<&Value>)

Source from the content-addressed store, hash-verified

410}
411
412fn extract_file_path(tool_input: Option<&Value>) -> Option<String> {
413 let value = tool_input?;
414 for key in ["file_path", "filePath", "path", "target_file"] {
415 if let Some(path) = value.get(key).and_then(Value::as_str) {
416 return Some(path.to_string());
417 }
418 }
419 None
420}
421
422fn insert_if_missing(raw: &mut Value, key: &str, value: Value) {
423 if let Some(obj) = raw.as_object_mut() {

Callers 1

normalize_tool_rawFunction · 0.70

Calls 1

getMethod · 0.65

Tested by

no test coverage detected