Skip to content

test(fastmcp): Remove unused MCP request helpers - #8275

Merged
alexander-alderman-webb merged 1 commit into
masterfrom
ref/fastmcp-remove-unused-mcp-call-helpers
Nov 16, 2026
Merged

alexander-alderman-webb merged 1 commit into
masterfrom
ref/fastmcp-remove-unused-mcp-call-helpers

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Description

Removes six helpers from tests/integrations/fastmcp/test_fastmcp.py that nothing calls: call_tool_through_mcp, call_prompt_through_mcp, call_resource_through_mcp, and their _async versions. Also removes the guarded mcp.types import (CallToolRequest, GetPromptRequest, ReadResourceRequest), which only those helpers used, and the module docstring paragraph that says all tests go through these low-level handlers. That paragraph is no longer true. 148 lines removed, nothing added.

Why they're dead: #5075 added the helpers. The tests then moved to real transports: stdio in #5333, Streamable HTTP in #5384, and SSE in #5400. Those PRs removed most of the call sites. #7420 ("Remove vacuous tests") removed the last call_tool_through_mcp(...) call, and the definitions stayed behind. On master, each name only appears at its own definition (and the sync names in the async versions' docstrings). json and asyncio are still used elsewhere in the file.

Why it's safe: it only touches tests. No SDK code, public API, documented behavior or dependency changes, and no test changes what it checks. No open PR touches tests/integrations/fastmcp/. major/3.0 has the exact same block, also unused, so merging master into it should apply cleanly.

Issues

None. Found by the weekly sentry-python removal scout.

via automation sched_65eed06cc199036c2b13411096f412d4 · Run ID sched_65eed06cc199036c2b13411096f412d4:1794816000000.

--

View Session [Sentry]

The call_{tool,prompt,resource}_through_mcp helpers and their async
variants have had no callers since the FastMCP tests moved to real
transports (#5333, #5384, #5400) and the last call site was removed
in #7420. Drop them, the mcp.types import that only they used, and
the module docstring paragraph that described them.
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 139222 passed | ⏭️ 7861 skipped | Total: 147083 | Pass Rate: 94.66% | Execution Time: 447m 38s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ Test counts unchanged from base.

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.25% (up 0.02 percentage points from base (26ef571) to head (aecf0c5)).

Coverage diff
@@            Coverage Diff             @@
##        master     #8275       +/-##
==========================================
+ Coverage    90.23%    90.25%    +0.02%
==========================================
  Files          203       203         —
  Tracked lines     27335     27335         —
  Branches     10246     10246         —
==========================================
+ Hits         24663     24669        +6
+ Misses        2672      2666        -6
- Partials      1556      1557        +1

Generated by Coverage Action

@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review November 16, 2026 08:36
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner November 16, 2026 08:36
@alexander-alderman-webb
alexander-alderman-webb merged commit cdeb6bf into master Nov 16, 2026
174 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the ref/fastmcp-remove-unused-mcp-call-helpers branch November 16, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant