test_every_tool_parameter_is_described¶
Tests › tests/test_mcp_server.py
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
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" )body = typing.get_type_hints(QueryTools.dossier, include_extras=True)["max_body_lines"]text = next(m.description for m in body.__metadata__ if getattr(m, "description", None))
When
- —
Then
- ✓ text contains "VERBATIM SOURCE"
- ✓ text contains "truncated"
tests/test_mcp_server.py:3539 · its file's page
What it checks (2)
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 attributedassert "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_schemaWhat 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)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-MCP-001 | catalog | unknown |
| REQ-DDB-MCP-003 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
| REQ-DDB-QUERY-008 | catalog | unknown |
| REQ-DDB-QUERY-009 | catalog | unknown |