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

Function extract_file_path

atomic-agent/src/hooks/codex.rs:578–587  ·  view source on GitHub ↗
(tool_input: Option<&Value>, response: &Value)

Source from the content-addressed store, hash-verified

576}
577
578fn extract_file_path(tool_input: Option<&Value>, response: &Value) -> Option<String> {
579 for value in [tool_input, Some(response)].into_iter().flatten() {
580 for key in ["file_path", "filePath", "path"] {
581 if let Some(path) = value.get(key).and_then(Value::as_str) {
582 return Some(path.to_string());
583 }
584 }
585 }
586 None
587}
588
589fn insert_if_missing(raw: &mut Value, key: &str, value: Value) {
590 if let Some(obj) = raw.as_object_mut() {

Callers 1

normalize_tool_rawFunction · 0.85

Calls 2

getMethod · 0.65
into_iterMethod · 0.45

Tested by

no test coverage detected