You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No mechanism on MCP and LangChain exceptions #5242
Errors captured by automatic instrumentation should have a mechanism so capture data is available, and the popularity of integrations can be determined. See
One correction worth flagging: the mechanism isn't missing, it's the default {"type": "generic", "handled": True} from utils.py:692. The handled: True
half is arguably the bigger problem — all six MCP call sites re-raise, so these
errors do reach the user's code, but they don't count as unhandled and don't
affect the crash-free rate.
While extending the tests I also found that under fastmcp==4.0.0b2 + mcp==2.0.0 a failing tool never reaches any of the six MCP capture sites
(measured with coverage: zero executed). fastmcp catches and logs it itself, and
the only event Sentry gets comes from LoggingIntegration, with mechanism.type == "logging". That also means test_fastmcp_tool_with_error
isn't currently exercising MCP error capture on that env. I left it out of the
PR since it's a separate problem — happy to open an issue for it if useful.
Activity
linear commentedon Dec 16, 2025
PY-2016
Add mechanism to captured exceptions.
gmassello commentedon Aug 22, 2026
Opened a draft PR for this: #7226
One correction worth flagging: the mechanism isn't missing, it's the default
{"type": "generic", "handled": True}fromutils.py:692. Thehandled: Truehalf is arguably the bigger problem — all six MCP call sites re-raise, so these
errors do reach the user's code, but they don't count as unhandled and don't
affect the crash-free rate.
While extending the tests I also found that under
fastmcp==4.0.0b2+mcp==2.0.0a failing tool never reaches any of the six MCP capture sites(measured with coverage: zero executed). fastmcp catches and logs it itself, and
the only event Sentry gets comes from
LoggingIntegration, withmechanism.type == "logging". That also meanstest_fastmcp_tool_with_errorisn't currently exercising MCP error capture on that env. I left it out of the
PR since it's a separate problem — happy to open an issue for it if useful.
fix(mcp,langchain): Add mechanism to captured exceptions (#7226)