Skip to content

Commit 9277c69

Browse files
Fixed match case for request types
1 parent a48cb68 commit 9277c69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mcp/client/session.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,18 @@ async def _received_request(
287287
)
288288

289289
match responder.request.root:
290-
case types.CreateMessageRequest:
290+
case types.CreateMessageRequest(params=params):
291291
if self._sampling_callback is not None:
292-
response = await self._sampling_callback(ctx, responder.request.root.params)
292+
response = await self._sampling_callback(ctx, params)
293293
client_response = types.ClientResult(root=response)
294294
with responder:
295295
await responder.respond(client_response)
296-
case types.ListRootsRequest:
296+
case types.ListRootsRequest():
297297
if self._list_roots_callback is not None:
298298
response = await self._list_roots_callback(ctx)
299299
client_response = types.ClientResult(root=response)
300300
with responder:
301301
await responder.respond(client_response)
302-
case types.PingRequest:
302+
case types.PingRequest():
303303
with responder:
304304
await responder.respond(types.ClientResult(root=types.EmptyResult()))

0 commit comments

Comments
 (0)