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

@show

Show HN: Strict MCP schemas rejected 10/10 bad calls; loose schemas: 0/10 github.com · 2 points · 0 comments · HN thread

TL;DR A GitHub companion lab for an MCP (Model Context Protocol) workshop that exposes one in-memory notes store through two schema designs: a deliberately loose v1 and a strict v2. The author reports that the strict schema rejected 10/10 adversarial calls while the loose one accepted all 10, and that v1 returned about 5.5 times as many result bytes across the 16 task calls. The project is a Show HN post with 2 points and no comments.

  • The server is pure Python stdlib, speaks JSON-RPC 2.0 over stdio, and implements initialize, tools/list and tools/call.
  • --schema v1 has three vague tools, a free-form action string, no required fields, bloated results and silent failures.
  • --schema v2 has six single-verb tools (create_note, get_note, update_note, delete_note, list_notes, search_notes) with required fields, additionalProperties false and structured errors.
  • audit.py reports that v1 silently accepts all 10 adversarial calls, three of which mutate the store, while v2 rejects all 10.
  • Across the 16 ground-truth task calls, v1 returns roughly 5.5 times as many result bytes as v2.
  • A pre-stated criterion says v2 wins only if wrong-tool calls fall at least 30% relative to v1 and task completion rises; the model trials are optional and need llama-cpp-python and a GGUF model.

Discussion No comments have been posted yet, so there is no discussion to summarize.

#MCP #llmTooling #jsonSchema #showHN #agents