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

Function summarize_execution

atomic-agent/src/provenance/classify.rs:591–606  ·  view source on GitHub ↗
(tool_name: &str, tool_input: Option<&serde_json::Value>)

Source from the content-addressed store, hash-verified

589}
590
591fn summarize_execution(tool_name: &str, tool_input: Option<&serde_json::Value>) -> String {
592 // For shell commands, show the command
593 let normalized = tool_name.to_lowercase();
594 if matches!(
595 normalized.as_str(),
596 "bash" | "terminal" | "shell" | "command" | "exec" | "run"
597 ) {
598 let cmd = extract_command(tool_input);
599 let cmd = cmd.trim();
600 if !cmd.is_empty() {
601 return truncate_for_summary(cmd, 300);
602 }
603 }
604
605 format!("Execute {}", tool_name)
606}
607
608/// Truncate a string for summary display, adding "..." if truncated.
609fn truncate_for_summary(s: &str, max_len: usize) -> String {

Callers 1

summarize_tool_callFunction · 0.85

Calls 3

truncate_for_summaryFunction · 0.85
extract_commandFunction · 0.70
is_emptyMethod · 0.45

Tested by

no test coverage detected