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

Function extract_tool_detail

atomic-agent/src/transcript/condense.rs:287–307  ·  view source on GitHub ↗

Extract appropriate detail for a tool call. For minimal-detail tools (Read, Skill, WebFetch), returns only the essential identifier (path, skill name, URL). For other tools, returns the most relevant field from the input.

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

Source from the content-addressed store, hash-verified

285/// essential identifier (path, skill name, URL). For other tools, returns
286/// the most relevant field from the input.
287fn extract_tool_detail(tool_name: &str, input: &serde_json::Value) -> Option<String> {
288 let parsed: ToolInput = serde_json::from_value(input.clone()).unwrap_or_default();
289
290 // Minimal detail tools — show only the identifier
291 if MINIMAL_DETAIL_TOOLS.contains(&tool_name) {
292 return match tool_name {
293 "Skill" => parsed.skill,
294 "Read" => parsed.file_path.or(parsed.notebook_path),
295 "WebFetch" => parsed.url,
296 _ => None,
297 };
298 }
299
300 // Other tools — use the most relevant field
301 parsed
302 .description
303 .or(parsed.command)
304 .or(parsed.file_path)
305 .or(parsed.notebook_path)
306 .or(parsed.pattern)
307}

Callers 1

Calls 2

cloneMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected