lean-builtin-tool-auditor
Skill11 starsChanged 20 days agoMITView on GitHub
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.
In this repository48 other files it gives its agents.
- agents.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- .agents/skills/react-native-skills/AGENTS.mdAGENTS.md
- .agents/skills/react-view-transitions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-initSkill
- agy-delegateSkill
- audit-docsSkill
- code-audit-expertSkill
- computer-diagnosisSkill
- create-builtin-toolSkill
- create-prSkill
- critique-builtin-toolSkill
- doc-auditorSkill
- docxSkill
- extract-log-debugSkill
- feature-refactor-proposalSkill
- gatekeeper-loopSkill
- harbor-harness-improvement-loopSkill
- i18n-language-standardsSkill
- jobs-trace-analyzerSkill
- libragent-qualitySkill
- libr-delegateSkill
- libr-tool-e2e-harness-loopSkill
- modular-large-file-refactorSkill
- performance-auditSkill
- pptxSkill
- vercel-react-best-practicesSkill
- vercel-react-native-skillsSkill
- vercel-react-view-transitionsSkill
- readme-showcase-syncSkill
- refactor-builtin-toolSkill
- release-managerSkill
- review-local-changesSkill
- review-pr-commentsSkill
- science-searchSkill
- setup-wizardSkill
- skill-creatorSkill
- soul-awakeningSkill
- sqlite-analyzerSkill
- sync-pending-approvalsSkill
- tool-creatorSkill
- trace-analyzerSkill
- trace-eval-loopSkill
- vitepress-doc-syncSkill
- worker-loopSkill
- x-cliSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Keep implementations simple and maintainable.
- Very specific: line 119
Read the tool schema (mod.rs or tools/*.rs)
- Distinctive: line 120
Read the handler implementation
- Distinctive: line 121
Read response building code for hints
- Distinctive: line 122
Check each dimension above
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- Parameters have correct types (string, number, boolean, object, array)
- Required fields are marked required
- Descriptions are clear and actionable for AI agents
- No redundant or unused parameters
- Enum values are exhaustive and correct
- Default values are safe and sensible
Anti-pattern:
// ❌ WRONG: Vague type, missing required, unclear description
props.insert("path".to_string(), string_prop(
None, None,
Some("file location")
));
// ✅ CORRECT: Explicit type, required, actionable description
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:
- No alias proliferation (one canonical name per tool)
- No unnecessary wrapper functions or indirection
- No over-generalized helpers that obscure logic
- Error handling is direct, not wrapped in multiple layers
- No premature abstraction for one-off cases
Anti-pattern:
// ❌ WRONG: Alias error hints bloat
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)),
}
// ✅ CORRECT: Simple match, agent learns from schema
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:
- Success hints only when agent needs guidance
- Error hints include 1-2 specific recovery steps
- No generic "Use toolX to do Y" when toolX is obvious
- No redundant hints already in message body
- No edit-promotion padding on read-only tools
- Hint text is copy-pasteable (includes exact parameters)
- Hints are outcome-conditioned: steady path stays empty/minimal; phase boundaries may escalate once; repeated failures escalate instead of repeating the same retry
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:
// ❌ WRONG: Bloated success hints on read-only tools
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(),
]
);
// ✅ CORRECT: Data speaks for itself
let hint = SuccessHint::new(
format!("Directory listing for '{}':\n\n{}", path, listing),
vec![] // Only add hints when agent actually needs next step
);Anti-pattern:
// ❌ WRONG: Vague error recovery
return Err("Operation failed".to_string());
// ✅ CORRECT: Specific recovery
return Err(format!(
"Process '{}' not found. Use listProcesses() to find active processes.",
process_id
));Audit Workflow
- Read the tool schema (
mod.rsortools/*.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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

