@@ -76,7 +76,7 @@ async def call_and_capture_error() -> None:
7676 await started .wait ()
7777 await client .session .send_notification (
7878 types .CancelledNotification (
79- params = types .CancelledNotificationParams (request_id = request_ids [0 ], reason = "user aborted" )
79+ params = types .CancelledNotificationParams (requestId = request_ids [0 ], reason = "user aborted" )
8080 )
8181 )
8282
@@ -96,14 +96,14 @@ async def list_tools(
9696 ) -> types .ListToolsResult :
9797 return types .ListToolsResult (
9898 tools = [
99- types .Tool (name = "block" , input_schema = {"type" : "object" }),
100- types .Tool (name = "echo" , input_schema = {"type" : "object" }),
99+ types .Tool (name = "block" , inputSchema = {"type" : "object" }),
100+ types .Tool (name = "echo" , inputSchema = {"type" : "object" }),
101101 ]
102102 )
103103
104104 async def call_tool (ctx : ServerRequestContext , params : types .CallToolRequestParams ) -> CallToolResult :
105105 if params .name == "echo" :
106- return CallToolResult (content = [TextContent (text = "still alive" )])
106+ return CallToolResult (content = [TextContent (type = "text" , text = "still alive" )])
107107 assert ctx .request_id is not None
108108 request_ids .append (ctx .request_id )
109109 started .set ()
@@ -123,12 +123,12 @@ async def call_and_swallow_cancellation_error() -> None:
123123 task_group .start_soon (call_and_swallow_cancellation_error )
124124 await started .wait ()
125125 await client .session .send_notification (
126- types .CancelledNotification (params = types .CancelledNotificationParams (request_id = request_ids [0 ]))
126+ types .CancelledNotification (params = types .CancelledNotificationParams (requestId = request_ids [0 ]))
127127 )
128128
129129 result = await client .call_tool ("echo" , {})
130130
131- assert result == snapshot (CallToolResult (content = [TextContent (text = "still alive" )]))
131+ assert result == snapshot (CallToolResult (content = [TextContent (type = "text" , text = "still alive" )]))
132132
133133
134134@requirement ("protocol:cancel:unknown-id-ignored" )
@@ -138,21 +138,21 @@ async def test_cancellation_for_unknown_request_is_ignored(connect: Connect) ->
138138 async def list_tools (
139139 ctx : ServerRequestContext , params : types .PaginatedRequestParams | None
140140 ) -> types .ListToolsResult :
141- return types .ListToolsResult (tools = [types .Tool (name = "echo" , input_schema = {"type" : "object" })])
141+ return types .ListToolsResult (tools = [types .Tool (name = "echo" , inputSchema = {"type" : "object" })])
142142
143143 async def call_tool (ctx : ServerRequestContext , params : types .CallToolRequestParams ) -> CallToolResult :
144144 assert params .name == "echo"
145- return CallToolResult (content = [TextContent (text = "unbothered" )])
145+ return CallToolResult (content = [TextContent (type = "text" , text = "unbothered" )])
146146
147147 server = Server ("calm" , on_list_tools = list_tools , on_call_tool = call_tool )
148148
149149 async with connect (server ) as client :
150150 await client .session .send_notification (
151- types .CancelledNotification (params = types .CancelledNotificationParams (request_id = 9999 ))
151+ types .CancelledNotification (params = types .CancelledNotificationParams (requestId = 9999 ))
152152 )
153153 result = await client .call_tool ("echo" , {})
154154
155- assert result == snapshot (CallToolResult (content = [TextContent (text = "unbothered" )]))
155+ assert result == snapshot (CallToolResult (content = [TextContent (type = "text" , text = "unbothered" )]))
156156
157157
158158@requirement ("protocol:cancel:late-response-ignored" )
@@ -192,9 +192,9 @@ def respond(request_id: types.RequestId, result: types.Result) -> SessionMessage
192192 respond (
193193 init .message .id ,
194194 InitializeResult (
195- protocol_version = "2025-11-25" ,
195+ protocolVersion = "2025-11-25" ,
196196 capabilities = ServerCapabilities (),
197- server_info = Implementation (name = "scripted" , version = "0.0.1" ),
197+ serverInfo = Implementation (name = "scripted" , version = "0.0.1" ),
198198 ),
199199 )
200200 )
0 commit comments