Commit 2b985dd
committed
mcp(test[server]): integration test card hints against real registered tools
``test_card_omits_invisible_tools`` proves the visibility filter's
*logic* using a synthetic 3-element ``visible_tool_names`` set. The
production wiring uses ~20+ names returned by
``asyncio.run(mcp.list_tools())`` after ``mcp.enable(tags=..., only=True)``
runs in ``run_server``. The two paths share code but are not the same
exercise.
Adds an integration test that registers the real tool surface, applies
the same ``mcp.enable(tags={TAG_READONLY}, only=True)`` call
``run_server`` makes, collects the visible names from
``mcp.list_tools()``, and asserts every hint phrase still appears in
the card. All three current hint tools (``snapshot_pane``,
``wait_for_text``, ``search_panes``) carry ``TAG_READONLY``, so even
the most restrictive tier keeps them visible — the test pins this
invariant. A future change that moves a hint tool out of the readonly
tier will fail this test and force a deliberate decision: retag the
tool, or drop the hint from ``_HANDLE_HINTS``.
The check is paired: each iteration asserts both that the hint tool is
actually in the visible set (catches an unexpected tier change) and
that the corresponding phrase is in the produced card (catches a
wiring regression).
Pure addition; no source changes.1 parent 258ecfb commit 2b985dd
1 file changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
350 | 395 | | |
351 | 396 | | |
352 | 397 | | |
| |||
0 commit comments