cd /news/ai-agents/show-hn-strict-mcp-schemas-rejected-… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-175490] src=github.com β†— pub= topic=ai-agents verified=true sentiment=↑ positive

Show HN: Strict MCP schemas rejected 10/10 bad calls; loose schemas: 0/10

A companion lab for The Architect's AI Workshop's Agent Series Episode 1 reports that strict MCP tool schemas rejected 10 out of 10 bad tool calls while the deliberately loose schema design rejected 0 out of 10, according to the lab's headline results. The lab, listed in the HOL Registry with a catalogue PR merged 2026-11-04, exposes one notes store through two schema designs in a pure Python standard-library MCP server: a v1 design with three vague tools, a free-form action string, no required fields and silent failures, and a v2 redesign with six single-verb tools (create_note, get_note, update_note, delete_note, list_notes, search_notes), required fields, additionalProperties: false and structured errors. The lab ships a minimal MCP client, 16 fixed user requests with a grading rubric, a trial runner and a deterministic audit script, and is tested with Python 3.12; the model-trial runner is the only component requiring a third-party package (llama-cpp-python plus a GGUF instruct model).

recommendation

Give each MCP tool one verb, mark fields required and set additionalProperties: false; the lab's strict v2 schema rejected 10/10 bad calls while the loose v1 rejected 0/10.

more in playbook: Designing agent systems
read4 min views3 publishedNov 24, 2026
Show HN: Strict MCP schemas rejected 10/10 bad calls; loose schemas: 0/10
Image: Michielbdejong (auto-discovered)

Companion lab for The Architect's AI Workshop, Agent Series Ep. 1 β€” "Build an MCP Server a Model Can Actually Use."

A language model never sees your server code. It sees tool names, descriptions and JSON schemas β€” and nothing else. So an MCP server is a user interface for a language model, and this lab measures what that means: it exposes one notes store through two schema designs and grades what happens when models try to use each one.

Listed in the HOL Registry β€” owner-verified listing (catalogue PR merged 2026-11-04).

  • notes_server.py β€” a real MCP server in pure Python stdlib (JSON-RPC 2.0 over stdio:initialize ,tools/list ,tools/call ).--schema v1 is deliberately ambiguous: three vague tools, a free-form action string, no required fields, bloated results, silent failures.--schema v2 is the redesign: one verb per tool, descriptions that say whennot to use the tool, strict schemas, compact results, structured errors.
  • mcp_client.py β€” a minimal MCP client (spawns the server, performs the handshake, lists and calls tools).
  • tasks.py β€” the fixed set of 16 user requests and the grading rubric (correct tool / wrong tool / malformed / task completed), applied identically to both versions.
  • run_trials.py β€” the experiment. A chooser sees only thetools/list output and a request, answers with one JSON tool call, and the call is executed for real against a fresh seeded server.
  • audit.py β€” deterministic, model-free measurements: an adversarial call suite, result-size totals, and a lexical confusability proxy (labelled a proxy β€” it measures shared words, not shared meaning).
  • validate.py β€” the test harness. Pure stdlib; run it first.

The server has no dependencies beyond Python itself β€” the server, the client and the harness are pure standard library (JSON-RPC 2.0 over stdio). Tested with Python 3.12.

git clone https://github.com/ranadhir19/mcp-server-lab.git
cd mcp-server-lab
python3 validate.py   # self-check: must end with OVERALL: PASS (5/5 stages)

That is the whole install: nothing to build, no package to install. (In fact the only command in this lab that needs a third-party package is the optional model-trial runner β€” see "Run it".)

An MCP client launches the server over stdio. Point the client at notes_server.py with --schema v2 to get the strict design: six tools (create_note, get_note, update_note, delete_note, list_notes, search_notes), required fields enforced, additionalProperties: false, and structured errors instead of silent failures. For any client that takes the standard mcpServers JSON (Claude Desktop, Claude Code, Cursor and others):

{
  "mcpServers": {
    "notes-strict": {
      "command": "python3",
      "args": ["/absolute/path/to/mcp-server-lab/notes_server.py", "--schema", "v2"]
    }
  }
}

Replace /absolute/path/to/mcp-server-lab with the directory you cloned into. With Claude Code, the same registration is one command:

claude mcp add notes-strict -- python3 /absolute/path/to/mcp-server-lab/notes_server.py --schema v2

Then ask the model to list, create, search, update or delete notes. Two things to know: the store starts from the same six seeded notes (n1–n6) on every launch, and state is in memory only β€” it resets when the server restarts, which is deliberate for a teaching lab. (--schema v1 swaps in the deliberately loose design, so you can watch the same client's calls fail against it.)

python3 validate.py          # 5 stages, must end with OVERALL: PASS
python3 audit.py             # deterministic audits -> audit_results.json
python3 run_trials.py --chooser oracle   # harness plumbing check only

Model trials (optional; needs pip install llama-cpp-python and a GGUF instruct model):

python3 run_trials.py --chooser llm --model path/to/model.gguf \
    --out trials_model.json

Question. Does schema redesign (v1 β†’ v2) change how often models pick the wrong tool, produce malformed calls, and complete the task?

Pre-stated success criterion. Pooled across the models tested, v2 counts as a win only if wrong-tool calls fall by at least 30% relative to v1 and task completion rises. Anything less and the honest conclusion is the other one: that description quality is not the lever β€” granularity or model capability is β€” and that is what gets reported. The criterion lives here, in writing, before the trials run; it does not move afterwards.

Method notes. Single-shot selection (one call per task, no retries), temperature 0, fresh seeded store per task, results inspected through the protocol itself. Models tested are small, locally run open models β€” the point is the comparison between schema versions on identical tasks, not a leaderboard. Small models are also where schema quality should matter most: a frontier model can often guess its way past a bad description; a small one cannot.

Run audit.py yourself: the loose v1 schema silently accepts all 10 adversarial calls (and three of them mutate the store); the strict v2 schema rejects all 10. Across the 16 ground-truth task calls, v1 returns roughly 5.5 times as many result bytes as v2. The lexical confusability proxy, interestingly, scores v2 worse β€” its longer descriptions share more vocabulary. Words are not meaning; that proxy is kept in the lab as a standing warning against cheap metrics.

── more in #ai-agents 4 stories Β· sorted by recency
── more on @the architect's ai workshop 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/show-hn-strict-mcp-s…] indexed:0 read:4min 2026-11-24 Β· β€”