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)
| 285 | /// essential identifier (path, skill name, URL). For other tools, returns |
| 286 | /// the most relevant field from the input. |
| 287 | fn 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 | } |
no test coverage detected