agentleFS
Wsh7AshWsh7Ash/skillmcp/skills/tool-call-error-paths/SKILL.md

tool-call-error-paths

Skill0 starsChanged 14 days agoMITView on GitHub

Exercise each error path deliberately so a bad argument cannot produce a silent success. Use when a tool validates arguments and the failure branches are untested

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the server continues serving after each error

    line 24
  2. Distinctive:

    Add the cases to the fixture transcript

    line 25
  3. Distinctive:

    every failure branch has a request and an asserted error code

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

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

Tool Call Error Paths

Exercise each error path deliberately so a bad argument cannot produce a silent success

Use when: a tool validates arguments and the failure branches are untested

Avoid when: the tool has no failure branches because it takes no input

Procedure

  1. Enumerate the failure branches in the handler
  2. Send a request that triggers each one
  3. Assert the error code and message for each case
  4. Assert that none of them returns a success envelope
  5. Check the server continues serving after each error
  6. Add the cases to the fixture transcript

Signals

  • missing required argument returns invalid params
  • out-of-range value returns invalid params with the key named
  • unknown tool name returns invalid params listing alternatives
  • each error leaves the server able to answer the next call

Patterns

1. Missing key

{"arguments": {}} for a required query

2. Out of range

limit 500 -> invalid params

3. Unknown tool

name 'nope' -> invalid params with the available list

Pitfalls

  • Testing only the happy path and shipping an error branch that returns success
  • Asserting the message text so tightly that a wording change breaks CI
  • Forgetting to re-check that the server still serves after an error

Done when

  • every failure branch has a request and an asserted error code
  • post-error liveness is verified in the same test

References

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.