(def: &ToolDefinition)
| 418 | } |
| 419 | |
| 420 | fn schema_required_keys(def: &ToolDefinition) -> Vec<String> { |
| 421 | def.input_schema |
| 422 | .get("required") |
| 423 | .and_then(Value::as_array) |
| 424 | .map(|arr| { |
| 425 | arr.iter() |
| 426 | .filter_map(|v| v.as_str().map(String::from)) |
| 427 | .collect() |
| 428 | }) |
| 429 | .unwrap_or_default() |
| 430 | } |
| 431 | |
| 432 | fn max_typo_distance(name: &str) -> usize { |
| 433 | if name.len() > 6 { |
no test coverage detected