Skip to main content
Glama
nntkio

UniFi MCP Server

by nntkio

restart_device

Restart a UniFi network device using its MAC address to resolve connectivity issues or apply configuration changes.

Instructions

Restart a UniFi network device by its MAC address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
macYesMAC address of the device to restart (e.g., '00:11:22:33:44:55')

Implementation Reference

  • MCP server tool handler for 'restart_device': extracts 'mac' from arguments, calls UniFiClient.restart_device(mac), and returns success TextContent message.
    case "restart_device":
        mac = arguments.get("mac", "")
        await client.restart_device(mac)
        return [
            TextContent(
                type="text",
                text=f"Restart command sent to device {mac}",
            )
        ]
  • Registers the 'restart_device' tool in the MCP server's list_tools() with name, description, and input schema requiring 'mac' string.
    Tool(
        name="restart_device",
        description="Restart a UniFi network device by its MAC address",
        inputSchema={
            "type": "object",
            "properties": {
                "mac": {
                    "type": "string",
                    "description": "MAC address of the device to restart (e.g., '00:11:22:33:44:55')",
                }
            },
            "required": ["mac"],
        },
    ),
  • Tool schema definition for 'restart_device': object with required 'mac' property (string).
    Tool(
        name="restart_device",
        description="Restart a UniFi network device by its MAC address",
        inputSchema={
            "type": "object",
            "properties": {
                "mac": {
                    "type": "string",
                    "description": "MAC address of the device to restart (e.g., '00:11:22:33:44:55')",
                }
            },
            "required": ["mac"],
        },
    ),
  • UniFiClient helper method: sends POST request to UniFi API endpoint /api/s/{site}/cmd/devmgr with JSON {"cmd": "restart", "mac": mac.lower()} to restart the device.
    async def restart_device(self, mac: str) -> bool:
        """Restart a network device.
    
        Args:
            mac: Device MAC address.
    
        Returns:
            True if restart command was sent successfully.
        """
        await self._request(
            "POST",
            "/api/s/{site}/cmd/devmgr",
            json={"cmd": "restart", "mac": mac.lower()},
        )
        return True
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Restart' implies a disruptive action, it doesn't specify whether this requires admin permissions, if the device becomes temporarily unavailable, potential side effects, or what happens on failure. This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized and front-loaded with the essential information.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't address behavioral aspects like permissions needed, disruption level, error conditions, or return values. Given the complexity of restarting network devices, more contextual information is needed.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents the single 'mac' parameter with format examples. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Restart') and target resource ('a UniFi network device by its MAC address'), distinguishing it from sibling tools like block_client or get_devices. It uses precise language that leaves no ambiguity about the tool's function.

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 disconnect_client or unblock_client, nor does it mention prerequisites or constraints. It simply states what the tool does without contextual usage information.

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