<< Home | Tech
Cut bad tool invocations in half
| Area | Tech |
| AI used | Claude |
| Source | r/mcp |
| Posted | 2026-09-19 |
The move
Collapse granular CRUD endpoints into broader, parameter-driven actions and refine tool descriptions to include negative constraints.Steps
- Identify groups of related CRUD endpoints in your MCP server.
- Consolidate these into a single tool using enum parameters to define the action.
- Rewrite tool descriptions to act as prompt instructions rather than technical documentation.
- Add explicit negative constraints to the description to tell the model when to avoid the tool.
Prompt for your AI
You are a tool for [Action Name]. Use this tool when [Specific Condition]. Do NOT use this tool if [Negative Constraint]. Use the 'action' parameter to specify whether you are performing [Action 1], [Action 2], or [Action 3].
What happened
The developer initially mirrored their REST API by creating a separate tool for every CRUD endpoint. This caused the AI to hallucinate and struggle with tool selection once the number of tools exceeded 15-20. By grouping actions and adding explicit instructions on when not to use a tool, they improved model reliability.Watch out
Over-generalizing tools can make them too complex for the model to parse correctly. Ensure parameter enums are strictly defined.Give it to your agent
Read https://howtheyuse.ai/p/cut-bad-tool-invocations-in-half.md and help me do this.