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

Function extract_tool_detail

atomic-agent/src/transcript/condense.rs:203–223  ·  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

201/// essential identifier (path, skill name, URL). For other tools, returns
202/// the most relevant field from the input.
203fn extract_tool_detail(tool_name: &str, input: &serde_json::Value) -> Option<String> {
204 let parsed: ToolInput = serde_json::from_value(input.clone()).unwrap_or_default();
205
206 // Minimal detail tools — show only the identifier
207 if MINIMAL_DETAIL_TOOLS.contains(&tool_name) {
208 return match tool_name {
209 "Skill" => parsed.skill,
210 "Read" => parsed.file_path.or(parsed.notebook_path),
211 "WebFetch" => parsed.url,
212 _ => None,
213 };
214 }
215
216 // Other tools — use the most relevant field
217 parsed
218 .description
219 .or(parsed.command)
220 .or(parsed.file_path)
221 .or(parsed.notebook_path)
222 .or(parsed.pattern)
223}

Callers 1

Calls 2

cloneMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected