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
fix: prevent validation errors from triggering MCP error callbacks
Previously, the tool system conflated two distinct types of errors:
1. Processing/validation errors (expected, normal flow)
2. Tool execution failures (unexpected, exceptional)
Both types were being passed to the MCP callback's error parameter,
causing validation failures to be treated as infrastructure errors
at the MCP protocol level.
This change ensures only actual exceptions trigger MCP error callbacks
by:
- Always passing 'false' for the error parameter in normal flow
- Maintaining exception handling for true tool failures
- Preserving validation errors in the result for proper handling
The commented-out original code (:error formatted) is retained for
reference, with extensive inline documentation explaining the
distinction between these error types and suggesting a future
enhancement to introduce :exception-error for clearer separation.
This aligns with error handling best practices where business logic
errors (validation, processing) are distinguished from system failures
(exceptions, infrastructure issues), ensuring the MCP protocol layer
only receives error signals for genuine tool malfunctions.
0 commit comments