Skip to main content
Glama
nntkio

UniFi MCP Server

by nntkio

get_site_health

Check the health status of a UniFi network site to monitor connectivity, device status, and overall network performance.

Instructions

Get health status for the current site

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler logic inside call_tool that fetches site health data using UniFiClient and returns formatted TextContent.
    case "get_site_health":
        health = await client.get_site_health()
        return [TextContent(type="text", text=format_health(health))]
  • Tool schema definition providing name, description, and input schema (no required properties).
    Tool(
        name="get_site_health",
        description="Get health status for the current site",
        inputSchema={
            "type": "object",
            "properties": {},
            "required": [],
        },
    ),
  • Registration of the call_tool decorator which handles dispatching to get_site_health among other tools.
    @server.call_tool()
    async def call_tool(name: str, arguments: dict[str, Any]) -> list[TextContent]:
  • UniFiClient helper method that performs the API request to retrieve raw site health data.
    async def get_site_health(self) -> list[dict[str, Any]]:
        """Get site health statistics.
    
        Returns:
            List of health metric dictionaries.
        """
        return await self._request("GET", "/api/s/{site}/stat/health")
  • Helper function to format the raw health data into a readable multi-line string with subsystem details.
    def format_health(health: list[dict[str, Any]]) -> str:
        """Format health data for display."""
        if not health:
            return "No health data available."
    
        lines = ["Site Health Status:\n"]
    
        for subsystem in health:
            subsys_name = subsystem.get("subsystem", "Unknown")
            status = subsystem.get("status", "unknown")
    
            lines.append(f"- {subsys_name.upper()}")
            lines.append(f"  Status: {status}")
    
            if subsys_name == "wan":
                gateways = subsystem.get("gw_mac", "N/A")
                lines.append(f"  Gateway: {gateways}")
            elif subsys_name == "wlan":
                num_ap = subsystem.get("num_ap", 0)
                num_user = subsystem.get("num_user", 0)
                lines.append(f"  Access Points: {num_ap}")
                lines.append(f"  Wireless Clients: {num_user}")
            elif subsys_name == "lan":
                num_sw = subsystem.get("num_sw", 0)
                num_user = subsystem.get("num_user", 0)
                lines.append(f"  Switches: {num_sw}")
                lines.append(f"  Wired Clients: {num_user}")
    
            lines.append("")
    
        return "\n".join(lines)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets' health status, implying a read operation, but doesn't specify what 'health status' includes (e.g., metrics, uptime, errors), whether it requires authentication, or how it handles errors. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero waste—it directly states the tool's purpose without fluff. It's appropriately sized for a simple tool and front-loaded with the essential information. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no annotations, and no output schema, the description is minimally adequate but lacks depth. It explains what the tool does but doesn't cover behavioral aspects like return format or error handling. For a simple read tool, it's complete enough to understand the basic purpose but misses contextual details that would help an agent use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The description appropriately doesn't mention parameters, avoiding redundancy. A baseline of 4 is justified as it doesn't add unnecessary information beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('health status for the current site'), making the purpose immediately understandable. It doesn't distinguish from siblings like 'get_sites' or 'get_devices', but it's specific enough to understand what it does. The description avoids tautology by not just restating the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_sites' or 'get_devices'. It implies usage for checking site health but doesn't specify context, prerequisites, or exclusions. Without any when-to-use information, it leaves the agent to guess based on sibling tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nntkio/unifiMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server