PR #1780 adds specific except UrlElicitationRequiredError: raise blocks in tool handlers to prevent this exception from being wrapped as a tool error.
Per SEP-1036, UrlElicitationRequiredError is not a regular error—it's a protocol-level flow control mechanism equivalent to elicitation/create. It needs to propagate as a JSON-RPC error response.
If more continuation-style exceptions are added in the future, consider an attribute-based pattern:
class McpError(Exception):
propagate_through_tool_handlers: bool = False
class UrlElicitationRequiredError(McpError):
propagate_through_tool_handlers = True
For now, YAGNI applies—we only have one such case.
PR #1780 adds specific
except UrlElicitationRequiredError: raiseblocks in tool handlers to prevent this exception from being wrapped as a tool error.Per SEP-1036,
UrlElicitationRequiredErroris not a regular error—it's a protocol-level flow control mechanism equivalent toelicitation/create. It needs to propagate as a JSON-RPC error response.If more continuation-style exceptions are added in the future, consider an attribute-based pattern:
For now, YAGNI applies—we only have one such case.