test_every_tool_parameter_is_described

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE ONLY UNTRUNCATABLE SURFACE, AND IT USED TO CARRY NOTHING. Parameter descriptions land in the JSON Schema, which a client re-sends whole on every request — while a measured 33% of every prose description is discarded at a 2,048-character cap. Before this, every parameter arrived as an auto-generated title and nothing else: `{"default": 120, "title": "Max Body Lines"}`.

Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009

Given

  1. for owner, name in ( (QueryTools, "dossier"), (QueryTools, "search"), (DocsDbServer, "index"), (DocsDbServer, "propose_declaration"), ): fn = getattr(owner, name) hints = typing.get_type_hints(fn, include_extras=True) undescribed = [] for pname, hint in hints.items(): if pname in ("return", "self", "ctx"): continue if not _described_in_schema(hint): undescribed.append(pname) assert not undescribed, ( f"{name}: {undescribed} carry no schema description, so they reach a model as bare " f"auto-titles in the one channel that is never truncated" )
  2. body = typing.get_type_hints(QueryTools.dossier, include_extras=True)["max_body_lines"]
  3. text = next(m.description for m in body.__metadata__ if getattr(m, "description", None))
→

When

  1. —
→

Then

  1. ✓ text contains "VERBATIM SOURCE"
  2. ✓ text contains "truncated"

tests/test_mcp_server.py:3539 · its file's page

What it checks (2)

  1. assert not undescribed, ( f"{name}: {undescribed} carry no schema description, so they reach a model as bare " f"auto-titles in the one channel that is never truncated" ) not attributed
  2. assert "VERBATIM SOURCE" in text and "truncated" in text, ( f"max_body_lines must state that it returns verbatim source and how to read past a " f"truncated body; got: {text!r}" ) not attributed

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_every_tool_parameter_is_described→_described_in_schema

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

Requirements it verifies (5)

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown