diff --git a/docs/clients/notifications.mdx b/docs/clients/notifications.mdx index 1780c0b37..aa7d47058 100644 --- a/docs/clients/notifications.mdx +++ b/docs/clients/notifications.mdx @@ -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")