tool-schema-design
Skill0 starsChanged 8 days agoMITView on GitHub
Design and review tool (function-calling) definitions that LLM agents call reliably - verb-object names, descriptions that say what, when and what it returns, typed parameters with descriptions, enums instead of prose lists, correct required fields, closed objects, small focused tools, clear error results - with a linter for JSON Schema tool definitions that flags missing descriptions, ambiguous parameter names, enum candidates, unknown required fields, missing types, array items, overlapping tools and duplicates. Use when writing or reviewing tools/functions for an agent, when the model calls the wrong tool or invents arguments, or when wrapping an internal API as agent tools.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- minpeter/minpeter-skillstheir own version, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- minpeter/minpeter-skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-deployment-checklistSkill
- agent-scopingSkill
- conversation-log-analysisSkill
- cost-latency-estimatorSkill
- eval-harnessSkill
- guardrails-and-safetySkill
- rag-ingestionSkill
- system-prompt-reviewSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 43
Write tools: idempotency key or natural key, dry-run/preview option when actions are costly.
- Very specific: line 57
Test tool selection: Write 3-5 eval cases per tool (should call / should not call / needs clarification) with tool_called / tool_not_called …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Tool schema design
The model only sees the tool name, description and parameter schema. Treat them as the user interface for the model: precise, unambiguous, and tested.
Paths below are relative to this skill's folder.
When to use
- Writing new tools/functions for an agent, or exposing an internal API as tools
- "The model picks the wrong tool", "it makes up arguments", "it never calls X"
- Reviewing a pull request that changes tool definitions
- Consolidating dozens of endpoint-shaped tools into fewer task-shaped ones
When not to use
- Designing the public HTTP API itself (that is API design, not tool design)
- Prompt wording outside the tool definitions: use
system-prompt-review - Deciding which tools the agent should have at all: start with
agent-scoping
Workflow
- List the tasks, not the endpoints. From the agent spec, write the user-level actions (e.g. "find an order for this customer"). One tool per action; merge endpoints that are always called together; split tools whose behaviour depends on a mode flag.
- Write each definition following references/design-rules.md:
- Name:
verb_object(lookup_order,create_return), unique, no genericdo_action. - Description: what it does, when to use it (and when not to), what it returns, side effects and whether the user must confirm first. 1-4 sentences.
- Parameters:
typeanddescriptionon every property, formats and examples in the description,enumfor fixed sets,minimum/maximumfor ranges,requiredlisting the mandatory ones,"additionalProperties": false. - Write tools: idempotency key or natural key, dry-run/preview option when actions are costly.
- Name:
- Lint the definitions.
Input can be one tool, a list, orpython3 scripts/tool_schema_lint.py tools.json python3 scripts/tool_schema_lint.py tools/*.json --json python3 scripts/tool_schema_lint.py tools.json --fail-on high --min-severity low{"tools": [...]}; flat (name,description,parameters/input_schema/inputSchema) or wrapped ({"type": "function", "function": {...}}). Exit 1 when findings at or above--fail-on(defaultmedium) exist. Add it to CI. - Design the results too. Return compact JSON with only the fields the model needs, stable
keys, and actionable errors (
{"error": "order_not_found", "hint": "ask for the order number from the confirmation email"}), never stack traces. See the results section in references/design-rules.md. - Test tool selection. Write 3-5 eval cases per tool (should call / should not call / needs
clarification) with
tool_called/tool_not_calledchecks ineval-harness. Overlapping tools flagged by the linter are the first suspects when selection fails. - Show the diff of the improved definitions and explain each change in one line.
Decision points
- More than ~15-20 tools: group by task, load tool subsets per conversation stage, or add a routing step; long tool lists reduce selection accuracy.
- Free-text parameter that is really a choice: make it an
enum; if the set is large or changes often, add a search/lookup tool instead. - The model must not see raw IDs: accept natural keys (order number + email) and resolve them server-side.
- Dangerous actions: split into
prepare_x(returns a summary) andconfirm_x(requires the token from prepare) so confirmation is enforced in code, not only in the prompt.
Output
tools.json: 6 tools, 9 findings (2 high, 4 medium, 3 low)
[HIGH] create_refund: 'required' lists 'order_id' which is not a property
[HIGH] helper: tool has no description
[MEDIUM] search_orders .status: description lists allowed values; use 'enum'
[MEDIUM] lookup_order, get_order: descriptions are 71% similar; say how they differ
Proposed: merge get_order into lookup_order, rename helper -> check_return_eligibility,
add enum ["open","shipped","delivered","returned"], fix required -> ["order_number"].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.

