File tree Expand file tree Collapse file tree
packages/toolbox-core/src/toolbox_core/mcp_transport Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ async def _send_request(
8888 elif (
8989 isinstance (err_val , str )
9090 and "invalid protocol version" in err_val .lower ()
91+ ) or (
92+ isinstance (err_val , dict )
93+ and "invalid protocol version" in str (err_val .get ("message" , "" )).lower ()
9194 ):
9295 client_supported = (
9396 self ._supported_protocols
Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ async def _send_request(
102102 elif (
103103 isinstance (err_val , str )
104104 and "invalid protocol version" in err_val .lower ()
105+ ) or (
106+ isinstance (err_val , dict )
107+ and "invalid protocol version" in str (err_val .get ("message" , "" )).lower ()
105108 ):
106109 client_supported = (
107110 self ._supported_protocols
Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ async def _send_request(
9393 elif (
9494 isinstance (err_val , str )
9595 and "invalid protocol version" in err_val .lower ()
96+ ) or (
97+ isinstance (err_val , dict )
98+ and "invalid protocol version" in str (err_val .get ("message" , "" )).lower ()
9699 ):
97100 client_supported = (
98101 self ._supported_protocols
Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ async def _send_request(
9393 elif (
9494 isinstance (err_val , str )
9595 and "invalid protocol version" in err_val .lower ()
96+ ) or (
97+ isinstance (err_val , dict )
98+ and "invalid protocol version" in str (err_val .get ("message" , "" )).lower ()
9699 ):
97100 client_supported = (
98101 self ._supported_protocols
Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ async def _send_request(
118118 elif (
119119 isinstance (err_val , str )
120120 and "invalid protocol version" in err_val .lower ()
121+ ) or (
122+ isinstance (err_val , dict )
123+ and "invalid protocol version" in str (err_val .get ("message" , "" )).lower ()
121124 ):
122125 # Cascading Fallback: Legacy servers throw this string error.
123126 # We pick the next version from the user's supported list.
You can’t perform that action at this time.
0 commit comments