async def test_resource_updates_via_tool(client: BasicMCPClient):
    """Test updating a resource via a tool and reading the changes."""
    # First read the initial user profile
    resource = await client.read_resource("users://123/profile")
    profile1 = resource.contents[0].text
    assert "Test User" in profile1

    # Update the user via the tool
    result = await client.call_tool(
        "update_user", {"user_id": "123", "name": "Updated User"}
    )

    profile2 = result.content[0].text
    assert "Updated User" in profile2
    assert "Test User" not in profile2
Test updating a resource via a tool and reading the changes.
llama-index-integrations/tools/llama-index-tools-mcp/tests/test_client.py