test_the_descriptions_name_every_subject_kind_the_tools_accept¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
A tool description is the only thing a model reads before choosing a tool, so a stale one is a live defect. WHAT THIS REPLACES: the `callers`/`callees` descriptions used to be checked field by field against the neighbour key set. Both tools are gone and their rows are `dossier` fields, so the equivalent live risk moved with them — and it got bigger, because a caller can no longer discover a capability by seeing a tool named after it.
Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
def described(fn: object, param: str) -> str: hint = typing.get_type_hints(fn, include_extras=True)[param] return next(m.description for m in hint.__metadata__ if getattr(m, "description", None))subject = described(QueryTools.dossier, "subject")
4 more
for kind in SUBJECT_KINDS: assert kind in subject or kind in TIER1_TOOLS["dossier"], ( f"dossier accepts subject kind {kind!r} and neither its schema nor its description " f"says so, which makes that kind unreachable in practice" )corpus = described(QueryTools.search, "corpus")for name in CORPORA: assert name in corpus or name in TIER1_TOOLS["search"], ( f"search reads corpus {name!r} and neither its schema nor its description says so" )surface = TIER1_TOOLS["dossier"] + " " + described(QueryTools.dossier, "depth")
When
- —
Then
- ✓ surface does not contain "returns strictly less"
- ✓ surface does not contain "direct CALL edges only"
- ✓ surface.lower() contains "depth"
- ✓ surface contains str(q_max_depth())
tests/test_mcp_server.py:1696 · its file's page
What it checks (6)
assert kind in subject or kind in TIER1_TOOLS["dossier"], ( f"dossier accepts subject kind {kind!r} and neither its schema nor its description " f"says so, which makes that kind unreachable in practice" )not attributedassert name in corpus or name in TIER1_TOOLS["search"], ( f"search reads corpus {name!r} and neither its schema nor its description says so" )not attributedassert "returns strictly less" not in surfacenot attributedassert "direct CALL edges only" not in surfacenot attributedassert "depth" in surface.lower()not attributedassert str(q_max_depth()) in surface, "the depth BOUND must be disclosed, not implied"observesq_max_depth
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_the_descriptions_name_every_subject_kind_the_tools_accept→q_max_depthWhat 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 |