get_offline_devices
Retrieve a list of offline devices from your UniFi network to identify connectivity issues and monitor network health.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/devices.js:169-188 (handler)The handler function that implements the get_offline_devices tool logic: retrieves all devices, filters for offline status, and returns formatted JSON response.handler: async () => { const allDevices = await unifi.listAllDevices(); const devices = allDevices.data || []; const offline = devices.filter(d => { const state = d.state; return state === 'OFFLINE' || state === 0 || state === 'DISCONNECTED'; }); return { content: [{ type: 'text', text: JSON.stringify({ offlineCount: offline.length, totalDevices: devices.length, offlineDevices: offline }, null, 2) }] }; }
- src/tools/devices.js:168-168 (schema)Zod input schema for get_offline_devices tool (no parameters required).schema: z.object({}),
- src/server.js:29-29 (registration)Registers the deviceTools object containing get_offline_devices into the MCP server via registerToolsFromModule.registerToolsFromModule(deviceTools);