@@ -964,6 +964,7 @@ async def call_tool(
964964 meta : RequestParamsMeta | None = None ,
965965 allow_input_required : Literal [False ] = False ,
966966 allow_claimed : Literal [False ] = False ,
967+ validate_output : bool = True ,
967968 ) -> types .CallToolResult : ...
968969
969970 @overload
@@ -979,6 +980,7 @@ async def call_tool(
979980 meta : RequestParamsMeta | None = None ,
980981 allow_input_required : bool ,
981982 allow_claimed : Literal [False ] = False ,
983+ validate_output : bool = True ,
982984 ) -> types .CallToolResult | types .InputRequiredResult : ...
983985
984986 @overload
@@ -994,6 +996,7 @@ async def call_tool(
994996 meta : RequestParamsMeta | None = None ,
995997 allow_input_required : Literal [False ] = False ,
996998 allow_claimed : bool ,
999+ validate_output : bool = True ,
9971000 ) -> types .CallToolResult | types .Result : ...
9981001
9991002 @overload
@@ -1009,6 +1012,7 @@ async def call_tool(
10091012 meta : RequestParamsMeta | None = None ,
10101013 allow_input_required : bool ,
10111014 allow_claimed : bool ,
1015+ validate_output : bool = True ,
10121016 ) -> types .CallToolResult | types .InputRequiredResult | types .Result : ...
10131017
10141018 async def call_tool (
@@ -1023,6 +1027,7 @@ async def call_tool(
10231027 meta : RequestParamsMeta | None = None ,
10241028 allow_input_required : bool = False ,
10251029 allow_claimed : bool = False ,
1030+ validate_output : bool = True ,
10261031 ) -> types .CallToolResult | types .InputRequiredResult | types .Result :
10271032 """Send a tools/call request with optional progress callback support.
10281033
@@ -1039,6 +1044,9 @@ async def call_tool(
10391044 so the caller can resolve the requests and retry.
10401045 allow_claimed: When `False` (default), a claimed extension result raises
10411046 `UnexpectedClaimedResult`; when `True`, the parsed claim model is returned.
1047+ validate_output: When `True` (default), the client's cached tool output schema
1048+ is validated against the returned structured content. When `False`, the
1049+ result is returned without schema validation.
10421050
10431051 Raises:
10441052 RuntimeError: If the server returns an `InputRequiredResult` and
@@ -1060,7 +1068,7 @@ async def call_tool(
10601068 progress_callback = progress_callback ,
10611069 )
10621070
1063- if isinstance (result , types .CallToolResult ) and not result .is_error :
1071+ if validate_output and isinstance (result , types .CallToolResult ) and not result .is_error :
10641072 await self .validate_tool_result (name , result )
10651073
10661074 # The input_required arm stays first; a claimed shape is terminal for the multi-round-trip driver.
0 commit comments