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

Function normalize_legacy_tool_args

src/tool_command/args.rs:187–205  ·  view source on GitHub ↗
(def: &ToolDefinition, args: &mut Map<String, Value>)

Source from the content-addressed store, hash-verified

185}
186
187fn normalize_legacy_tool_args(def: &ToolDefinition, args: &mut Map<String, Value>) -> Result<()> {
188 if def.name != "tracedecay_fact_store" {
189 return Ok(());
190 }
191 let Some(fact_type) = args.remove("fact_type") else {
192 return Ok(());
193 };
194 if let Some(category) = args.get("category") {
195 if category != &fact_type {
196 return Err(TraceDecayError::Config {
197 message: "`fact_type` is a legacy alias for `category`; pass only `category`"
198 .to_string(),
199 });
200 }
201 } else {
202 args.insert("category".to_string(), fact_type);
203 }
204 Ok(())
205}
206
207/// Keys that integration layers inject into tool arguments for routing, read
208/// by the dispatch layer (or the generated client itself) rather than being

Callers 1

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected