Skip to main content
Glama
vandreus

UniFi MCP Server

by vandreus

locate_device

Find and identify UniFi network devices on your network to manage connectivity and troubleshoot issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the locate_device tool. It calls the unifi.locateDevice helper and formats the response as MCP content.
    handler: async ({ hostId, deviceId, enabled }) => { const result = await unifi.locateDevice(hostId, deviceId, enabled); return { content: [{ type: 'text', text: `Device locate mode ${enabled ? 'enabled' : 'disabled'}. ${JSON.stringify(result, null, 2)}` }] }; }
  • Zod input schema for the locate_device tool defining required hostId, deviceId, and optional enabled parameters.
    schema: z.object({ hostId: z.string().describe('The host ID'), deviceId: z.string().describe('The device ID'), enabled: z.boolean().optional().default(true).describe('Enable or disable locator mode') }),
  • The complete registration of the locate_device tool within the deviceTools object, including description, schema, and handler.
    locate_device: { description: 'Flash the LEDs on a device to help physically locate it', schema: z.object({ hostId: z.string().describe('The host ID'), deviceId: z.string().describe('The device ID'), enabled: z.boolean().optional().default(true).describe('Enable or disable locator mode') }), handler: async ({ hostId, deviceId, enabled }) => { const result = await unifi.locateDevice(hostId, deviceId, enabled); return { content: [{ type: 'text', text: `Device locate mode ${enabled ? 'enabled' : 'disabled'}. ${JSON.stringify(result, null, 2)}` }] }; } },
  • Helper function that performs the actual API call to the UniFi Cloud API to toggle device locator mode (LED flashing). Called by the tool handler.
    export async function locateDevice(hostId, deviceId, enabled = true) { const response = await cloudApi.post(`/v1/hosts/${hostId}/devices/${deviceId}/locate`, { enabled }); return response.data; }

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/vandreus/Unifi-MCP'

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