docs: fix stale .root notification access for MCP SDK v2

This commit is contained in:
Jeremiah Lowin 2026-07-06 00:31:17 -04:00
commit 9e2fef8254
No known key found for this signature in database

View file

@ -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")