add-tool
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Scaffold a new FastMCP tool following project conventions. Use when: adding a new tool, creating an LLM-callable action, implementing a new MCP tool endpoint, adding tool tests, or extending the server with a new capability. Asks questions then generates the tool file, registers the import, and creates matching tests.
We split this skill into the rules it gives an agent
8 rules. 0 are common, 1 is distinctive, and 7 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Before asking questions, read pyproject.toml to find the current package name from:
- Very specific: line 25
Use this as PACKAGE for all file paths and imports below.
- Very specific: line 29
Ask the following questions.
- Very specific: line 43
Create src/PACKAGE/tools/TOOL_NAME.py using ./assets/tool_template.md as the base.
- Very specific: line 58
Add the import line to src/PACKAGE/__main__.py after the existing tool imports:
- Very specific: line 64
Keep the # noqa: F401 comment — the import is intentional for side-effect registration.
- Very specific: line 68
Create tests/test_TOOL_NAME.py using ./assets/test_template.md as the base.
- Distinctive: line 77
Run and confirm both pass:
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a New FastMCP Tool
Scaffolds a fully wired FastMCP tool in the correct location following the conventions already used in this project.
When to use
- Adding any new MCP tool to the server
- Wanting a correctly structured tool file and matching tests in one step
- Unsure about parameter annotations, error handling, or async patterns
Step 1 — Detect the package name
Before asking questions, read pyproject.toml to find the current package name from:
packages = ["src/<package_name>"]Use this as PACKAGE for all file paths and imports below.
Step 2 — Interview the user
Ask the following questions. Use vscode_askQuestions if available.
| # | Question | Notes |
| 1 | Tool name | snake_case, action-oriented (e.g. fetch_weather, resolve_dns_record) |
| 2 | What does this tool do? | One sentence — becomes the docstring |
| 3 | Parameters | Name, type, description for each. Ask one at a time if unclear |
| 4 | Sync or async? | Default: async for any I/O, sync for pure computation |
| 5 | Read-only or destructive? | Read-only → add readOnlyHint=True; destructive → add destructiveHint=True |
| 6 | What should raise a ToolError? | e.g. invalid input, network failure, resource not found |
| 7 | Does it need external I/O? | If yes, suggest adding an HTTP client or DB pool via app_lifespan |
Step 3 — Generate the tool file
Create src/PACKAGE/tools/TOOL_NAME.py using ./assets/tool_template.md as the base.
Fill in:
- The import block (
syncorasyncvariant) @mcp.tool()decorator with hints if applicable- Function signature with all
Annotatedparameters - Docstring from the tool description answer
- Logger call using
get_tool_logger("TOOL_NAME") - Return type annotation
ToolErrorraises for the stated error cases
See ./references/tool-conventions.md for exact patterns.
Step 4 — Register the import in __main__.py
Add the import line to src/PACKAGE/__main__.py after the existing tool imports:
from PACKAGE.tools import TOOL_NAME # noqa: F401Keep the # noqa: F401 comment — the import is intentional for side-effect registration.
Step 5 — Generate the test file
Create tests/test_TOOL_NAME.py using ./assets/test_template.md as the base.
Include at minimum:
- A success-path test using
await client.call_tool("TOOL_NAME", {...}) - An error-path test using
raise_on_error=Falseand assertingresult.is_error - A test for any default parameter values if applicable
Step 6 — Validate
Run and confirm both pass:
ruff check .
pytest tests/test_TOOL_NAME.py -vFix any issues before reporting completion.
Step 7 — Report
Tell the user:
- The path of the new tool file
- The path of the new test file
- What was added to
__main__.py - Any suggestions for next steps (e.g. if the tool needs
lifespancontext for an HTTP client)
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- takeshy/obsidian-gemini-helper★ 118same name
- hhopke/intervals-icu-mcp★ 114same name
- Azure-Samples/art-voice-agent-accelerator★ 74same name
- takeshy/obsidian-llm-hub★ 38same name
- ooloth/dotfiles★ 24same name
- Cognigy/cognigy-plugin★ 18same name
- PinMeTo/pinmeto-location-mcp★ 15same name
- microsoft/PilotSwarm★ 14same name
- alunduil/alunduil-chezmoi★ 2same name
- eborden/logseq-mcp-server★ 2same name
9 more not listed
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 repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-resourceSkill
- add-routeSkill
- auth-setupSkill
- bootstrap-personalizeSkill
- deployment-profileSkill
- docs-syncSkill
- observability-setupSkill
- release-readinessSkill
- rename-projectSkill
- test-scaffoldSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

