agentleFS
HalemoGPAHalemoGPA/whatsapp-mcp-server/.claude/skills/add-tool/SKILL.md

add-tool

Skill8 starsChanged 3 months agoMITView on GitHub

Add a new MCP tool to this WhatsApp server. Use when asked to expose a new capability, wrap a new bridge endpoint, or add a tool to tools.py or scheduling.py. Covers annotations, the confirm guard, core-set placement, retrieval aliases, and the eval case.

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-provider and release.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • PydanticSkill

    add-provider

    Add a new inference provider to genai-prices, including provider data, matching, usage extractors, update automation, cassettes, agentic checks, generated artifacts, and Python/JavaScript/Go parity tests. Use for a new provider, not a new model on an existing provider.

    Also in 3 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 1

    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
  1. Very specific:

    If the tool's name and description do not share vocabulary with how a person would ask for it, find_tool cannot rank it.

    line 60
  2. Very specific:

    Add an entry to _ALIASES in toolsearch.py:

    line 64
  3. Distinctive:

    Write real phrasings. Do not copy strings out of the eval cases.

    line 70
  4. Very specific:

    Add the handler in whatsapp-bridge/main.go, then a thin wrapper in whatsapp.py, then the tool in tools.py.

    line 96

“Common” is measured: kept by at least 6 in 10 of the 19 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adding an MCP tool

Five steps. Skipping step 3 or 4 produces a tool that exists but that the model can never find, which is the same as not shipping it.

1. Write the tool

Tools live in whatsapp-mcp-server/tools.py (general) or scheduling.py (queue, drafts, notes). Register with @mcp.tool(annotations=...) using one of the five constants defined at the top of tools.py:

ConstantFor
READ_LOCALReads the local store. No network, no side effect.
READ_BRIDGEReads via the bridge (touches the network), no side effect.
SENDSends a message or file, non-idempotent.
MUTATEChanges state, recoverable (react, mark read, edit).
DESTRUCTIVEIrreversible: delete, revoke, leave, block.

A DESTRUCTIVE tool takes confirm: bool = False and calls _require_confirm before doing anything:

@mcp.tool(annotations=DESTRUCTIVE)
def delete_thing(thing_id: str, confirm: bool = False) -> dict:
    """One-line summary the model reads.

    Args:
        thing_id: ...
        confirm: Must be True. The user, not the LLM, has to have agreed.
    """
    if (denied := _require_confirm(confirm)) is not None:
        return denied
    ...

The annotation is only a hint to the client. The confirm kwarg is the actual enforcement, and it exists because older MCP clients do not support elicitation.

Clamp every caller-supplied bound. The existing tools use limit <= 100, context windows <= 20, message body <= 65536 bytes. Match them.

2. Decide whether it belongs in the core set

_CORE_TOOLS in server.py is the 29-tool hot core served directly in the default minimal toolset. Every entry there is paid for on every request to the model, whether or not WhatsApp is touched.

The bar: would a typical session use this in the first three calls? If not, leave it out. It stays fully reachable through find_tool / call_tool. Most new tools should not be in the core.

3. Make it findable

If the tool's name and description do not share vocabulary with how a person would ask for it, find_tool cannot rank it. schedule_message never lexically matches "send this tomorrow morning".

Add an entry to _ALIASES in toolsearch.py:

"your_tool": "the words a user would actually say for this thing",

Write real phrasings. Do not copy strings out of the eval cases. An alias map tuned against its own answer key measures nothing.

4. Add an eval case

Append to tests/toolsearch-eval/cases.json:

{"q": "how someone would phrase the task", "gold": "your_tool", "alts": ["a genuinely correct substitute"]}

alts is for tools that would also be a right answer, not near misses. Then run the eval and confirm recall did not drop.

5. Verify

pytest
ruff check .

Then, against a live server, add a line to tests/smoke.sh and run it. A tool that has never been called over real HTTP is not done.

If the tool needs a new bridge endpoint

Add the handler in whatsapp-bridge/main.go, then a thin wrapper in whatsapp.py, then the tool in tools.py. Keep the wrapper thin: the query and retry logic belongs in whatsapp.py, the MCP-facing shape belongs in tools.py.

Rebuild with the FTS5 tag or the bridge crash-loops:

go build -tags sqlite_fts5 ./...

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.