mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 22:14:18 +02:00
docs: fix stale .root notification access for MCP SDK v2
This commit is contained in:
parent
ae77de82ee
commit
9e2fef8254
1 changed files with 2 additions and 2 deletions
|
|
@ -22,8 +22,8 @@ from fastmcp import Client
|
|||
|
||||
async def message_handler(message):
|
||||
"""Handle MCP notifications from the server."""
|
||||
if hasattr(message, 'root'):
|
||||
method = message.root.method
|
||||
if hasattr(message, 'method'):
|
||||
method = message.method
|
||||
|
||||
if method == "notifications/tools/list_changed":
|
||||
print("Tools have changed - refresh tool cache")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue