agentleFS
Wsh7AshWsh7Ash/skillmcp/skills/input-schema-strictness/SKILL.md

input-schema-strictness

Skill0 starsChanged 14 days agoMITView on GitHub

Make the input schema the only place argument rules live, and refuse anything outside it. Use when a tool accepts structured arguments that a model will construct from context

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Test one rejection per rule so the schema is enforced, not documented

    line 25
  2. Distinctive:

    every argument has a type and a required flag

    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

Input Schema Strictness

Make the input schema the only place argument rules live, and refuse anything outside it

Use when: a tool accepts structured arguments that a model will construct from context

Avoid when: the tool takes no arguments at all

Procedure

  1. List every argument, its type, and whether it is required
  2. Declare enums for closed sets and bounds for numeric limits
  3. Set additionalProperties to false so unknown keys are rejected
  4. Validate again inside the handler, because the schema is advisory to the client
  5. Return invalid-params with the offending key named
  6. Test one rejection per rule so the schema is enforced, not documented

Signals

  • an unknown argument produces an invalid-params error
  • an out-of-range number is refused rather than clamped silently
  • the error message names the field and the expected shape
  • the handler validation matches the declared schema exactly

Patterns

1. Closed object

"additionalProperties": false

2. Bounded integer

"minimum": 1, "maximum": 50

3. Typed error

invalid params: limit must be between 1 and 50

Pitfalls

  • Trusting client-side validation and skipping handler checks
  • Silently clamping a value and returning success, which hides the client's bug
  • Declaring an object where a string would be unambiguous for a model

Done when

  • every argument has a type and a required flag
  • at least one rejection test exists per constraint

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.