[Core] MCP Tools: Implement 4 specific tools + meta tools #1

Closed
opened 2026-01-01 20:06:41 -06:00 by b3nw · 0 comments
Owner

Overview

Implement the core MCP tools following the Hybrid MCP Light pattern.

Specific Tools (4 total)

Tool Purpose Endpoint
unifi_list_clients List connected clients GET /api/s/{site}/stat/sta
unifi_list_devices List network devices GET /api/s/{site}/stat/device
unifi_get_system_info Controller info/version GET /api/s/{site}/stat/sysinfo
unifi_get_network_health Overall health status GET /api/s/{site}/stat/health

Meta Tools (don't count toward limit)

Tool Purpose
unifi_tool_index Return tool catalog with schemas
unifi_api_call Raw API pass-through (escape hatch)

Tasks

  • Implement unifi_list_clients with optional filtering
  • Implement unifi_list_devices with optional filtering
  • Implement unifi_get_system_info
  • Implement unifi_get_network_health
  • Implement unifi_tool_index returning all tool schemas
  • Implement unifi_api_call pass-through with write protection
  • Return JSON strings (not dicts) per BLUEPRINT best practice
  • Add comprehensive docstrings for LLM context

API Call Tool Signature

@mcp.tool()
def unifi_api_call(
    endpoint: str,
    method: str = "GET",
    params: str = "{}"
) -> str:
    """Execute raw UniFi API call. Refer to 'unifi://api-reference' resource.
    
    Args:
        endpoint: API path (e.g., '/api/s/default/stat/sta')
        method: HTTP method (GET, POST, PUT, DELETE)
        params: JSON string of request body/parameters
    """

Acceptance Criteria

  • All 4 specific tools return valid data from UniFi
  • unifi_tool_index returns complete schema catalog
  • unifi_api_call works for GET requests
  • unifi_api_call blocks writes when UNIFI_ALLOW_WRITES=false
## Overview Implement the core MCP tools following the Hybrid MCP Light pattern. ## Specific Tools (4 total) | Tool | Purpose | Endpoint | |------|---------|----------| | `unifi_list_clients` | List connected clients | `GET /api/s/{site}/stat/sta` | | `unifi_list_devices` | List network devices | `GET /api/s/{site}/stat/device` | | `unifi_get_system_info` | Controller info/version | `GET /api/s/{site}/stat/sysinfo` | | `unifi_get_network_health` | Overall health status | `GET /api/s/{site}/stat/health` | ## Meta Tools (don't count toward limit) | Tool | Purpose | |------|--------| | `unifi_tool_index` | Return tool catalog with schemas | | `unifi_api_call` | Raw API pass-through (escape hatch) | ## Tasks - [ ] Implement `unifi_list_clients` with optional filtering - [ ] Implement `unifi_list_devices` with optional filtering - [ ] Implement `unifi_get_system_info` - [ ] Implement `unifi_get_network_health` - [ ] Implement `unifi_tool_index` returning all tool schemas - [ ] Implement `unifi_api_call` pass-through with write protection - [ ] Return JSON strings (not dicts) per BLUEPRINT best practice - [ ] Add comprehensive docstrings for LLM context ## API Call Tool Signature ```python @mcp.tool() def unifi_api_call( endpoint: str, method: str = "GET", params: str = "{}" ) -> str: """Execute raw UniFi API call. Refer to 'unifi://api-reference' resource. Args: endpoint: API path (e.g., '/api/s/default/stat/sta') method: HTTP method (GET, POST, PUT, DELETE) params: JSON string of request body/parameters """ ``` ## Acceptance Criteria - All 4 specific tools return valid data from UniFi - `unifi_tool_index` returns complete schema catalog - `unifi_api_call` works for GET requests - `unifi_api_call` blocks writes when `UNIFI_ALLOW_WRITES=false`
b3nw closed this issue 2026-01-01 20:21:15 -06:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: b3nw/unifi-mcp-light#1