@@ -261,13 +261,15 @@ class ToolsCapability(BaseModel):
261261 """Whether this server supports notifications for changes to the tool list."""
262262 model_config = ConfigDict (extra = "allow" )
263263
264+
264265class AsyncCapability (BaseModel ):
265266 """Capability for async operations."""
266267
267268 maxKeepAliveTime : int | None = None
268269 """The maximum keep alive time in seconds for async requests."""
269270 model_config = ConfigDict (extra = "allow" )
270271
272+
271273class LoggingCapability (BaseModel ):
272274 """Capability for logging operations."""
273275
@@ -287,7 +289,7 @@ class ServerCapabilities(BaseModel):
287289 """Present if the server offers any resources to read."""
288290 tools : ToolsCapability | None = None
289291 """Present if the server offers async tool calling support."""
290- async_ : AsyncCapability | None = Field (alias = ' async' , default = None )
292+ async_ : AsyncCapability | None = Field (alias = " async" , default = None )
291293
292294 """Present if the server offers any tools to call."""
293295 model_config = ConfigDict (extra = "allow" )
@@ -813,57 +815,81 @@ class CallToolRequestParams(RequestParams):
813815 arguments : dict [str , Any ] | None = None
814816 model_config = ConfigDict (extra = "allow" )
815817
818+
816819class CallToolRequest (Request [CallToolRequestParams , Literal ["tools/call" ]]):
817820 """Used by the client to invoke a tool provided by the server."""
818821
819822 method : Literal ["tools/call" ]
820823 params : CallToolRequestParams
821824
825+
822826class CallToolAsyncRequestParams (CallToolRequestParams ):
823827 """Parameters for calling a tool asynchronously."""
824828
825829 keepAlive : int | None = None
826830 model_config = ConfigDict (extra = "allow" )
827831
828- class CallToolAsyncRequest (Request [CallToolAsyncRequestParams , Literal ["tools/async/call" ]]):
832+
833+ class CallToolAsyncRequest (
834+ Request [CallToolAsyncRequestParams , Literal ["tools/async/call" ]]
835+ ):
829836 """Used by the client to invoke a tool provided by the server asynchronously."""
837+
830838 method : Literal ["tools/async/call" ]
831839 params : CallToolAsyncRequestParams
832840
841+
833842class JoinCallToolRequestParams (RequestParams ):
834843 """Parameters for joining an asynchronous tool call."""
844+
835845 token : AsyncToken
836846 keepAlive : int | None = None
837847 model_config = ConfigDict (extra = "allow" )
838848
839- class JoinCallToolAsyncRequest (Request [JoinCallToolRequestParams , Literal ["tools/async/join" ]]):
840- """Used by the client to join an tool call executing on the server asynchronously."""
849+
850+ class JoinCallToolAsyncRequest (
851+ Request [JoinCallToolRequestParams , Literal ["tools/async/join" ]]
852+ ):
853+ """Used by the client to join an tool call executing on the server
854+ asynchronously."""
855+
841856 method : Literal ["tools/async/join" ]
842857 params : JoinCallToolRequestParams
843858
859+
844860class CancelToolAsyncNotificationParams (NotificationParams ):
845861 token : AsyncToken
846862
847- class CancelToolAsyncNotification (Notification [CancelToolAsyncNotificationParams , Literal ["tools/async/cancel" ]]):
863+
864+ class CancelToolAsyncNotification (
865+ Notification [CancelToolAsyncNotificationParams , Literal ["tools/async/cancel" ]]
866+ ):
848867 method : Literal ["tools/async/cancel" ]
849868 params : CancelToolAsyncNotificationParams
850869
870+
851871class GetToolAsyncResultRequestParams (RequestParams ):
852872 token : AsyncToken
853873
854- class GetToolAsyncResultRequest (Request [GetToolAsyncResultRequestParams , Literal ["tools/async/get" ]]):
874+
875+ class GetToolAsyncResultRequest (
876+ Request [GetToolAsyncResultRequestParams , Literal ["tools/async/get" ]]
877+ ):
855878 method : Literal ["tools/async/get" ]
856879 params : GetToolAsyncResultRequestParams
857880
881+
858882class CallToolResult (Result ):
859883 """The server's response to a tool call."""
860884
861885 content : list [TextContent | ImageContent | EmbeddedResource ]
862886 isError : bool = False
863887 isPending : bool = False
864888
889+
865890class CallToolAsyncResult (Result ):
866891 """The servers response to an async tool call"""
892+
867893 token : AsyncToken | None = None
868894 recieved : int | None = None
869895 keepAlive : int | None = None
0 commit comments