@@ -53,7 +53,14 @@ class Meta(BaseModel):
5353
5454 model_config = ConfigDict (extra = "allow" )
5555
56+ class Operation (BaseModel ):
57+ token : str
58+ """The token associated with the originating asynchronous tool call."""
59+ model_config = ConfigDict (extra = "allow" )
60+
5661 meta : Meta | None = Field (alias = "_meta" , default = None )
62+ operation : Operation | None = Field (alias = "_operation" , default = None )
63+ """Async operation parameters, only used when a request is sent during an asynchronous tool call."""
5764
5865
5966class PaginatedRequestParams (RequestParams ):
@@ -68,11 +75,18 @@ class NotificationParams(BaseModel):
6875 class Meta (BaseModel ):
6976 model_config = ConfigDict (extra = "allow" )
7077
78+ class Operation (BaseModel ):
79+ token : str
80+ """The token associated with the originating asynchronous tool call."""
81+ model_config = ConfigDict (extra = "allow" )
82+
7183 meta : Meta | None = Field (alias = "_meta" , default = None )
7284 """
7385 See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
7486 for notes on _meta usage.
7587 """
88+ operation : Operation | None = Field (alias = "_operation" , default = None )
89+ """Async operation parameters, only used when a notification is sent during an asynchronous tool call."""
7690
7791
7892RequestParamsT = TypeVar ("RequestParamsT" , bound = RequestParams | dict [str , Any ] | None )
@@ -106,11 +120,20 @@ class Notification(BaseModel, Generic[NotificationParamsT, MethodT]):
106120class Result (BaseModel ):
107121 """Base class for JSON-RPC results."""
108122
123+ class Operation (BaseModel ):
124+ token : str
125+ """The token associated with the originating asynchronous tool call."""
126+ model_config = ConfigDict (extra = "allow" )
127+
109128 meta : dict [str , Any ] | None = Field (alias = "_meta" , default = None )
110129 """
111130 See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
112131 for notes on _meta usage.
113132 """
133+ operation : Operation | None = Field (alias = "_operation" , default = None )
134+ """
135+ Async operation parameters, only used when a result is sent in response to a request with operation parameters.
136+ """
114137 model_config = ConfigDict (extra = "allow" )
115138
116139
@@ -896,25 +919,25 @@ class AsyncResultProperties(BaseModel):
896919
897920
898921# Async status checking types
899- class CheckToolAsyncStatusParams (RequestParams ):
922+ class GetOperationStatusParams (RequestParams ):
900923 """Parameters for checking async tool status."""
901924
902925 token : str
903926 """Token from the original async tool call."""
904927
905928
906- class CheckToolAsyncStatusRequest (Request [CheckToolAsyncStatusParams , Literal ["tools/async/status" ]]):
929+ class GetOperationStatusRequest (Request [GetOperationStatusParams , Literal ["tools/async/status" ]]):
907930 """Request to check the status of an async tool call."""
908931
909932 method : Literal ["tools/async/status" ] = "tools/async/status"
910- params : CheckToolAsyncStatusParams
933+ params : GetOperationStatusParams
911934
912935
913936"""Status values for async operations."""
914- AsyncOperationStatus = Literal ["submitted" , "working" , "completed" , "canceled" , "failed" , "unknown" ]
937+ AsyncOperationStatus = Literal ["submitted" , "working" , "input_required" , " completed" , "canceled" , "failed" , "unknown" ]
915938
916939
917- class CheckToolAsyncStatusResult (Result ):
940+ class GetOperationStatusResult (Result ):
918941 """Result of checking async tool status."""
919942
920943 status : AsyncOperationStatus
@@ -924,21 +947,21 @@ class CheckToolAsyncStatusResult(Result):
924947
925948
926949# Async payload retrieval types
927- class GetToolAsyncPayloadParams (RequestParams ):
950+ class GetOperationPayloadParams (RequestParams ):
928951 """Parameters for getting async tool payload."""
929952
930953 token : str
931954 """Token from the original async tool call."""
932955
933956
934- class GetToolAsyncPayloadRequest (Request [GetToolAsyncPayloadParams , Literal ["tools/async/result" ]]):
957+ class GetOperationPayloadRequest (Request [GetOperationPayloadParams , Literal ["tools/async/result" ]]):
935958 """Request to get the result of a completed async tool call."""
936959
937960 method : Literal ["tools/async/result" ] = "tools/async/result"
938- params : GetToolAsyncPayloadParams
961+ params : GetOperationPayloadParams
939962
940963
941- class GetToolAsyncPayloadResult (Result ):
964+ class GetOperationPayloadResult (Result ):
942965 """Result containing the final async tool call result."""
943966
944967 result : "CallToolResult"
@@ -950,7 +973,7 @@ class CallToolRequestParams(RequestParams):
950973
951974 name : str
952975 arguments : dict [str , Any ] | None = None
953- async_properties : AsyncRequestProperties | None = Field (serialization_alias = "async " , default = None )
976+ operation_params : AsyncRequestProperties | None = Field (serialization_alias = "operation " , default = None )
954977 """Optional async execution parameters."""
955978 model_config = ConfigDict (extra = "allow" )
956979
@@ -969,7 +992,7 @@ class CallToolResult(Result):
969992 structuredContent : dict [str , Any ] | None = None
970993 """An optional JSON object that represents the structured result of the tool call."""
971994 isError : bool = False
972- async_properties : AsyncResultProperties | None = Field (serialization_alias = "async " , default = None )
995+ operation_result : AsyncResultProperties | None = Field (serialization_alias = "operation " , default = None )
973996 """Optional async execution information. Present when tool is executed asynchronously."""
974997
975998
@@ -1313,8 +1336,8 @@ class ClientRequest(
13131336 | UnsubscribeRequest
13141337 | CallToolRequest
13151338 | ListToolsRequest
1316- | CheckToolAsyncStatusRequest
1317- | GetToolAsyncPayloadRequest
1339+ | GetOperationStatusRequest
1340+ | GetOperationPayloadRequest
13181341 ]
13191342):
13201343 pass
@@ -1398,8 +1421,8 @@ class ServerResult(
13981421 | ReadResourceResult
13991422 | CallToolResult
14001423 | ListToolsResult
1401- | CheckToolAsyncStatusResult
1402- | GetToolAsyncPayloadResult
1424+ | GetOperationStatusResult
1425+ | GetOperationPayloadResult
14031426 ]
14041427):
14051428 pass
0 commit comments