{"slug": "show-hn-strict-mcp-schemas-rejected-10-10-bad-calls-loose-schemas-0-10", "title": "Show HN: Strict MCP schemas rejected 10/10 bad calls; loose schemas: 0/10", "summary": "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).", "body_md": "Companion lab for The Architect's AI Workshop, Agent Series Ep. 1 —\n**\"Build an MCP Server a Model Can Actually Use.\"**\n\nA language model never sees your server code. It sees tool names,\ndescriptions and JSON schemas — and nothing else. So an MCP server is\na *user interface for a language model*, and this lab measures what\nthat means: it exposes one notes store through two schema designs and\ngrades what happens when models try to use each one.\n\n**Listed in the [HOL Registry](https://hol.org/plugins)** — owner-verified\nlisting (catalogue PR merged 2026-11-04).\n\n- `notes_server.py` — a real MCP server in pure Python stdlib\n(JSON-RPC 2.0 over stdio:`initialize` ,`tools/list` ,`tools/call` ).`--schema v1` is deliberately ambiguous: three vague tools, a\nfree-form action string, no required fields, bloated results, silent\nfailures.`--schema v2` is the redesign: one verb per tool,\ndescriptions that say when*not* to use the tool, strict schemas,\ncompact results, structured errors.\n- `mcp_client.py` — a minimal MCP client (spawns the server, performs\nthe handshake, lists and calls tools).\n- `tasks.py` — the fixed set of 16 user requests and the grading\nrubric (correct tool / wrong tool / malformed / task completed),\napplied identically to both versions.\n- `run_trials.py` — the experiment. A chooser sees only the`tools/list` output and a request, answers with one JSON tool call,\nand the call is executed for real against a fresh seeded server.\n- `audit.py` — deterministic, model-free measurements: an adversarial\ncall suite, result-size totals, and a lexical confusability proxy\n(labelled a proxy — it measures shared words, not shared meaning).\n- `validate.py` — the test harness. Pure stdlib; run it first.\n\nThe 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.\n\n```\ngit clone https://github.com/ranadhir19/mcp-server-lab.git\ncd mcp-server-lab\npython3 validate.py   # self-check: must end with OVERALL: PASS (5/5 stages)\n```\n\nThat 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\".)\n\nAn MCP client launches the server over stdio. Point the client at\n`notes_server.py` with `--schema v2` to get the strict design: six\ntools (`create_note`, `get_note`, `update_note`, `delete_note`,\n`list_notes`, `search_notes`), required fields enforced,\n`additionalProperties: false`, and structured errors instead of\nsilent failures. For any client that takes the standard\n`mcpServers` JSON (Claude Desktop, Claude Code, Cursor and others):\n\n```\n{\n  \"mcpServers\": {\n    \"notes-strict\": {\n      \"command\": \"python3\",\n      \"args\": [\"/absolute/path/to/mcp-server-lab/notes_server.py\", \"--schema\", \"v2\"]\n    }\n  }\n}\n```\n\nReplace `/absolute/path/to/mcp-server-lab` with the directory you\ncloned into. With Claude Code, the same registration is one command:\n\n```\nclaude mcp add notes-strict -- python3 /absolute/path/to/mcp-server-lab/notes_server.py --schema v2\n```\n\nThen ask the model to list, create, search, update or delete notes.\nTwo things to know: the store starts from the same six seeded notes\n(n1–n6) on every launch, and state is in memory only — it resets\nwhen the server restarts, which is deliberate for a teaching lab.\n(`--schema v1` swaps in the deliberately loose design, so you can\nwatch the same client's calls fail against it.)\n\n```\npython3 validate.py          # 5 stages, must end with OVERALL: PASS\npython3 audit.py             # deterministic audits -> audit_results.json\npython3 run_trials.py --chooser oracle   # harness plumbing check only\n```\n\nModel trials (optional; needs `pip install llama-cpp-python` and a\nGGUF instruct model):\n\n```\npython3 run_trials.py --chooser llm --model path/to/model.gguf \\\n    --out trials_model.json\n```\n\n**Question.** Does schema redesign (v1 → v2) change how often models\npick the wrong tool, produce malformed calls, and complete the task?\n\n**Pre-stated success criterion.** Pooled across the models tested,\nv2 counts as a win only if **wrong-tool calls fall by at least 30%\nrelative to v1** and **task completion rises**. Anything less and the\nhonest conclusion is the other one: that description quality is not\nthe lever — granularity or model capability is — and that is what gets\nreported. The criterion lives here, in writing, before the trials run;\nit does not move afterwards.\n\n**Method notes.** Single-shot selection (one call per task, no\nretries), temperature 0, fresh seeded store per task, results\ninspected through the protocol itself. Models tested are small,\nlocally run open models — the point is the *comparison* between\nschema versions on identical tasks, not a leaderboard. Small models\nare also where schema quality should matter most: a frontier model\ncan often guess its way past a bad description; a small one cannot.\n\nRun `audit.py` yourself: the loose v1 schema silently accepts all 10\nadversarial calls (and three of them mutate the store); the strict v2\nschema rejects all 10. Across the 16 ground-truth task calls, v1\nreturns roughly 5.5 times as many result bytes as v2. The lexical\nconfusability proxy, interestingly, scores v2 *worse* — its longer\ndescriptions share more vocabulary. Words are not meaning; that proxy\nis kept in the lab as a standing warning against cheap metrics.", "url": "https://wpnews.pro/news/show-hn-strict-mcp-schemas-rejected-10-10-bad-calls-loose-schemas-0-10", "canonical_source": "https://github.com/ranadhir19/mcp-server-lab", "published_at": "2026-11-24 15:18:56+00:00", "updated_at": "2026-11-24 15:42:17.210624+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools"], "entities": ["The Architect's AI Workshop", "HOL Registry", "MCP", "Claude Desktop", "Claude Code", "Cursor", "llama-cpp-python", "Python 3.12"], "also_reported_by": [], "takeaway": "Redesigning MCP tool schemas from three vague tools with a free-form action string and no required fields to six single-verb tools with required fields and additionalProperties: false rejected 10 of 10 bad calls versus 0 of 10 under the loose design.", "recommendation": {"advice": "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.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/show-hn-strict-mcp-schemas-rejected-10-10-bad-calls-loose-schemas-0-10", "markdown": "https://wpnews.pro/news/show-hn-strict-mcp-schemas-rejected-10-10-bad-calls-loose-schemas-0-10.md", "text": "https://wpnews.pro/news/show-hn-strict-mcp-schemas-rejected-10-10-bad-calls-loose-schemas-0-10.txt", "jsonld": "https://wpnews.pro/news/show-hn-strict-mcp-schemas-rejected-10-10-bad-calls-loose-schemas-0-10.jsonld"}}