Skip to content

fix(mcp): Handle None arguments in tool and prompt handlers - #7387

Open
alexander-alderman-webb wants to merge 1 commit into
webb/mcp/inline-extract_handler_data_from_argsfrom
webb/mcp/allow-none-arguments
Open

fix(mcp): Handle None arguments in tool and prompt handlers#7387
alexander-alderman-webb wants to merge 1 commit into
webb/mcp/inline-extract_handler_data_from_argsfrom
webb/mcp/allow-none-arguments

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

Description

Just following the types, arguments can be None. For example:

https://github.com/modelcontextprotocol/python-sdk/blob/d060b36e1d095ef6e93e07ba5d59bb69b2ad449a/src/mcp-types/mcp_types/_types.py#L1449-L1453

The prompt case is recorded in the reported issue.

Issues

Closes #7374

Reminders

@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner September 4, 2026 12:53
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

130596 passed | ⏭️ 7110 skipped | Total: 137706 | Pass Rate: 94.84% | Execution Time: 466m 25s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +32305
Passed Tests 📈 +31674
Failed Tests
Skipped Tests 📈 +631

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2509 uncovered lines.
✅ Project coverage is 90.24%. Comparing base (885ac3b) to head (193785c).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/mcp.py 100.00% ⚠️ 2 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
+ Coverage    90.24%    90.24%        —%
==========================================
  Files          193       193         —
  Lines        25724     25713       -11
  Branches      9504      9494       -10
==========================================
+ Hits         23214     23204       -10
- Misses        2510      2509        -1
- Partials      1435      1432        -3

Generated by Codecov Action

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.

MCP integration: prompts/get without arguments crashes with 'NoneType' object has no attribute 'items' (mcp v1 server, positional arguments=None)

1 participant