MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / categorize_normalized_tool

Function categorize_normalized_tool

src/analytics.rs:88–120  ·  view source on GitHub ↗
(normalized: &str, command_hint: Option<&str>)

Source from the content-addressed store, hash-verified

86}
87
88fn categorize_normalized_tool(normalized: &str, command_hint: Option<&str>) -> UsageCategory {
89 if normalized.starts_with("tracedecay_memory")
90 || normalized == "tracedecay_fact_store"
91 || normalized == "tracedecay_memory_status"
92 {
93 return UsageCategory::Memory;
94 }
95 if normalized.starts_with("tracedecay_lcm")
96 || normalized.contains("session")
97 || normalized.contains("transcript")
98 {
99 return UsageCategory::LcmSession;
100 }
101 if normalized.starts_with("tracedecay_") {
102 return UsageCategory::TraceDecayGraph;
103 }
104 if matches!(
105 normalized,
106 "read" | "readfile" | "cat" | "sed" | "grep" | "rg" | "glob" | "search" | "find"
107 ) {
108 return UsageCategory::BroadFileSearch;
109 }
110 if matches!(normalized, "apply_patch" | "edit" | "write") {
111 return UsageCategory::Edit;
112 }
113 if matches!(
114 normalized,
115 "bash" | "shell" | "exec_command" | "functions.exec_command"
116 ) {
117 return command_hint.map_or(UsageCategory::Shell, command_category);
118 }
119 UsageCategory::Other
120}
121
122pub fn categorize_skill(raw: &str) -> UsageCategory {
123 let normalized = raw.trim().to_ascii_lowercase();

Callers 1

insert_tool_eventFunction · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected