| name | lean-builtin-tool-auditor |
| description | Audit builtin MCP tool implementations in LibrAgent for schema accuracy, minimal complexity, and non-bloated hints. Use when reviewing builtin tools for compliance, validating tool schemas, checking for over-engineering, or ensuring next-action hints are concise and relevant. |
Lean Builtin Tool Auditor
Audit builtin MCP tools against three principles: correct schemas, no over-engineering, minimal relevant hints.
1. Schema Correctness
Tool schemas must be accurate and complete.
Check:
Anti-pattern:
props.insert("path".to_string(), string_prop(
None, None,
Some("file location")
));
props.insert("path".to_string(), string_prop(
Some(1), Some(255),
Some("Absolute or relative path to target file")
));
2. No Over-Engineering
Keep implementations simple and maintainable.
Check:
Anti-pattern:
match tool_name {
"readFile" => self.handle_read_file(...),
"read_file" | "read" => Ok(MCPResult::error("Did you mean 'readFile'?")),
_ => Err(format!("Tool '{}' not found", tool_name)),
}
match tool_name {
"readFile" => self.handle_read_file(...),
_ => Err(format!("Tool '{}' not found", tool_name)),
}
3. Hints Without Bloat
Next-action and recovery hints must be required, relevant, and concise.
Check:
Exception (not bloat): State-gated escalation after a milestone or stuck loop is intentional augmentation. Fixed "always promote sibling tool X" on every call is bloat.
Anti-pattern:
let hint = SuccessHint::new(
format!("Directory listing for '{}':\n\n{}", path, listing),
vec![
format!("Use readFile('{}/filename')", path),
format!("Use listDirectory('{}/subdir')", path),
"Use search to find content".to_string(),
]
);
let hint = SuccessHint::new(
format!("Directory listing for '{}':\n\n{}", path, listing),
vec![]
);
Anti-pattern:
return Err("Operation failed".to_string());
return Err(format!(
"Process '{}' not found. Use listProcesses() to find active processes.",
process_id
));
Audit Workflow
- Read the tool schema (
mod.rs or tools/*.rs)
- Read the handler implementation
- Read response building code for hints
- Check each dimension above
- Report only high-confidence issues
Reference
For full design standard, see docs/guides/builtin_tool_bp.md.