(def: &ToolDefinition, args: &mut Map<String, Value>)
| 185 | } |
| 186 | |
| 187 | fn 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 |
no test coverage detected