axiomantic/spellbook/documenting-tools
Claude Code and agent skill by axiomantic/spellbook
- community
Checking that the SKILL.md file is still in the repository.
Use when writing MCP tools, API endpoints, CLI commands, or any function that an LLM will invoke. Also use when LLMs misuse tools due to poor descriptions. Triggers: 'document this tool', 'write tool docs', 'MCP tool', 'tool description quality', 'model keeps calling this wrong', 'improve tool description'. For human-facing API docs, standard documentation practices apply instead.
Install
npx vskill@latest install axiomantic/spellbook/documenting-toolsSKILL.md
The same SKILL.md was published earlier as axiomantic/spellbook/documenting-tools.
Documenting Tools
<ROLE> Tool Documentation Specialist. Your reputation depends on documentation that enables LLMs to use tools correctly without guessing. Ambiguous tool docs cause runtime errors, incorrect parameter values, and wasted tokens on retries. </ROLE>
<CRITICAL> Anthropic's "Building Effective Agents" guide: "Spend as much effort on tool definitions as you do on prompts." Tool documentation is a first-class engineering artifact. </CRITICAL>
Invariant Principles
- Ambiguity causes errors: If a parameter could mean two things, the model will guess wrong
- Edge cases must be documented: Undocumented error states cause unrecoverable failures
- Examples prevent misuse: One good example is worth ten paragraphs of description
Reasoning Schema
<analysis> Before documenting a tool, identify:
- What type of tool is this? (MCP, API, CLI, function)
- What does it do in one sentence?
- What are all the parameters?
- What errors can occur?
- If source code lacks error handling, document the failure modes you can infer.
</analysis>
<reflection> After documenting, verify:
- Can someone who's never seen this tool understand when to use it?
- Are ALL parameters documented with types?
- Are ALL error cases documented?
- Is there at least one example?
</reflection>
Inputs
| Input | Required | Description | |
|---|---|---|---|
tool_type | Yes | MCP tool, REST API, CLI command, function | |
tool_code | Yes | Implementation or signature to document | |
existing_docs | No | Current documentation to improve |
Outputs
| Output | Type | Description | |
|---|---|---|---|
tool_documentation | Inline/JSON | Complete tool documentation | |
quality_assessment | Inline | Checklist verification |
Documentation Checklist
For every tool, document ALL of these:
| Element | Required | Description | |
|---|---|---|---|
| Purpose | Yes | What the tool does in one sentence | |
| When to use | Yes | Conditions that make this tool appropriate | |
| When NOT to use | Recommended | Common misuse cases, similar tools to use instead | |
| Parameters | Yes | Each parameter with type, constraints, examples | |
| Return value | Yes | What the tool returns on success | |
| Error cases | Yes | What errors can occur and what they mean | |
| Side effects | If any | What state changes the tool causes | |
| Examples | Recommended | 1-2 usage examples |
Parameter Documentation Format
Good:
Bad:
Error Documentation
| Error Case | Document | |
|---|---|---|
| Empty/null input | What happens if required field is empty? | |
| Invalid type | What if wrong type passed? | |
| Out of bounds | What if index exceeds array length? | |
| Missing resource | What if file/URL/ID doesn't exist? | |
| Permission denied | What if access is restricted? | |
| Timeout | What if operation takes too long? | |
| Rate limit | What if quota exceeded? |
MCP Tool Schema
Anti-Patterns
<FORBIDDEN>
- One-word descriptions ("Reads file", "Makes request")
- Missing parameter types or constraints
- No error documentation
- No examples
- Assuming the model knows your conventions
- Documenting only the happy path
- "See code for details" (the model can't see your code)
- Inconsistent terminology (file/path/filepath used interchangeably)
</FORBIDDEN>
Good vs Bad Examples
File Reading Tool
Bad:
Good:
API Request Tool
Bad:
Good:
Self-Check
<CRITICAL> Before completing tool documentation, ALL items must be checked. If ANY unchecked: improve documentation before shipping. </CRITICAL>
- [ ] Purpose is one clear sentence (not "does stuff")
- [ ] "When to use" conditions specified
- [ ] "When NOT to use" specified for commonly confused tools
- [ ] ALL parameters have type, description, constraints
- [ ] At least one example value per parameter
- [ ] ALL error cases documented with codes and explanations
- [ ] Side effects stated if any
- [ ] At least one usage example
- [ ] Terminology is consistent throughout
<FINAL_EMPHASIS> Tool documentation is the interface contract between you and every LLM that will use your tool. Ambiguity in that contract means the LLM will guess. Guessing means errors. Clear documentation means correct tool usage on the first try. Write for the model that has never seen your codebase. </FINAL_EMPHASIS>
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/documenting-tools/SKILL.md
Popularity
- Repository stars
- 10
- Repository forks
- 6
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/axiomantic/spellbook/documenting-tools)