list_all_devices
Retrieve all network devices managed by the UniFi Cloud API for monitoring and configuration purposes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/devices.js:12-17 (handler)The MCP tool handler function for 'list_all_devices'. It calls unifi.listAllDevices() and returns the devices as formatted JSON in the MCP content format.handler: async () => { const devices = await unifi.listAllDevices(); return { content: [{ type: 'text', text: JSON.stringify(devices, null, 2) }] }; }
- src/tools/devices.js:11-11 (schema)Zod schema for the tool input, which takes no parameters.schema: z.object({}),
- src/server.js:28-32 (registration)Registration of the deviceTools module (containing list_all_devices) into the MCP server via registerToolsFromModule.registerToolsFromModule(networkTools); registerToolsFromModule(deviceTools); registerToolsFromModule(clientTools); registerToolsFromModule(protectTools); registerToolsFromModule(accessTools);
- src/unifi-client.js:89-92 (helper)Helper function that performs the actual API call to list all UniFi devices across all hosts and sites.export async function listAllDevices() { const response = await cloudApi.get('/v1/devices'); return response.data; }