add-tool
Skill2 starsChanged 3 months agoMITView on GitHub
Scaffold a new agent tool with a typed Zod schema, a safe
- Reads credentials
10 other projects use a version of this.
Adopted by
Most recently taken up by
- ooloth/dotfilestheir own version, first seen Oct 5, 2026
- alunduil/alunduil-chezmoitheir own version, first seen Oct 4, 2026
- Dipeshpal/capestheir own version, first seen Sep 27, 2026
- hhopke/intervals-icu-mcptheir own version, first seen Sep 2, 2026
- PinMeTo/pinmeto-location-mcptheir own version, first seen Jul 29, 2026
- agenticstack-sh/agenticstack-skillstheir own version, first seen Jun 8, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- hhopke/intervals-icu-mcp★ 87same name
- takeshy/obsidian-llm-hub★ 36same name
- ooloth/dotfiles★ 24same name
- Cognigy/cognigy-plugin★ 16same name
- PinMeTo/pinmeto-location-mcp★ 15same name
- microsoft/PilotSwarm★ 4same name
- agenticstack-sh/agenticstack-skills★ 2same name
- alunduil/alunduil-chezmoi★ 2same name
- Dipeshpal/capes★ 1same name
- ficaviolaodorata520/met-museum-mcp-server★ 0same 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 repository4 other files it gives its agents.
- agent-evalSkill
- deploy-agentSkill
- prompt-diffSkill
- trace-debugSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Ask for these in one message, not one at a time:
- Distinctive: line 53
Keep the object keys snake_case (that's what the model sees) and the identifiers camelCase (that's what TypeScript prefers).
- Very specific: line 61
Update
.env.example: if the tool needs a new env var. - Very specific: line 89
No silent truncation: If a response is truncated for size, return a field like truncated: true so the model knows.
- Very specific: line 91
No unbounded loops: If the tool paginates, cap page count and return { nextPageToken, truncated: true } when hit.
“Common” is measured: kept by at least 6 in 10 of the 10 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-tool
Purpose: keep every new tool consistent with the existing four — same shape, same safety rails, same test coverage — so tool sprawl doesn't turn the agent into an unpredictable mess.
When to fire
- User says: "add a tool for X", "create a tool that calls Y", "the agent needs to be able to Z", "scaffold a tool".
- User pastes an API spec and asks the agent to wrap it.
Inputs you need
Ask for these in one message, not one at a time:
- Tool name — snake_case, verb-first (e.g.
send_email, notemail_tool). - One-line description — what the model sees when deciding whether to call it.
- Parameters — name, type, whether required, one-line description per param.
- Where the data comes from — HTTP call? Local file? Shell? DB?
- Failure modes — what returns an
{ error }object vs what throws.
Steps
- Create
./agent/tools/<name>.tsusing the template in./skills/add-tool/resources/template.ts. Fill in:- Zod schema mirroring the parameters spec.
executebody implementing the call.- Explicit early return with
{ error: "..." }for every failure mode identified in input 5. Never throw for expected failures — the agent handles error objects gracefully but a throw ends the turn.
- Register it in
./agent/tools/index.ts:
Keep the object keys snake_case (that's what the model sees) and the identifiers camelCase (that's what TypeScript prefers).import { <camelName>Tool } from "./<name>"; export const tools = { ..., <name>: <camelName>Tool, } as const; - Add a smoke eval case to
./evals/cases/tools.jsonl. Every tool must have at least one case that assertstool_calledfor its name, plus one negative case that ensures it does NOT get called for irrelevant queries. Copy the pattern from existing entries. - Update
.env.exampleif the tool needs a new env var. Add a comment explaining what happens when the var is missing (the tool should degrade gracefully — seeweb_searchas reference). - Type check + eval.
Both must be green before you consider the tool done.npm run typecheck npm run eval
Definition of done
- New file at
./agent/tools/<name>.tsmatching the template shape. - Entry added to
./agent/tools/index.ts. - At least two new cases in
./evals/cases/tools.jsonl(positive + negative). .env.exampleupdated if applicable.npm run typecheckpasses.npm run evalpasses (or the user acknowledges an expected regression and approves).
Anti-patterns to avoid
- No side-channel state. Tools must be pure functions of their inputs plus process env. No module-level mutable caches.
- No
any. The Zod schema is the contract;executemust be typed againstz.infer<typeof schema>. - No silent truncation. If a response is truncated for size, return
a field like
truncated: trueso the model knows. - No unbounded loops. If the tool paginates, cap page count and
return
{ nextPageToken, truncated: true }when hit.
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.

