get_wireless_clients
Retrieve connected wireless clients from UniFi network infrastructure to monitor device activity and manage network access.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/clients.js:243-263 (handler)Full tool definition including schema and handler. The handler fetches all clients using unifi.listAllClients(), filters for wireless clients (those without isWired or is_wired flag), and returns a JSON summary with counts and list.get_wireless_clients: { description: 'Get all wireless (WiFi) clients', schema: z.object({}), handler: async () => { const allClients = await unifi.listAllClients(); const clients = allClients.data || []; const wireless = clients.filter(c => !c.isWired && !c.is_wired); return { content: [{ type: 'text', text: JSON.stringify({ wirelessCount: wireless.length, totalClients: clients.length, wirelessClients: wireless }, null, 2) }] }; } },
- src/server.js:28-32 (registration)Registers the clientTools module (containing get_wireless_clients) by calling registerToolsFromModule(clientTools). This function iterates over the tools object and calls server.tool() for each.registerToolsFromModule(networkTools); registerToolsFromModule(deviceTools); registerToolsFromModule(clientTools); registerToolsFromModule(protectTools); registerToolsFromModule(accessTools);
- src/server.js:16-25 (registration)Helper function that registers all tools from a module object (like clientTools) into the MCP server using server.tool(name, schema, handler).const registerToolsFromModule = (toolsModule) => { Object.entries(toolsModule).forEach(([name, toolConfig]) => { server.tool( name, toolConfig.schema, toolConfig.handler, { description: toolConfig.description } ); }); };
- src/unifi-client.js:125-130 (helper)Helper function called by the handler to retrieve all clients across hosts and sites from UniFi API.export async function listAllClients() { const response = await cloudApi.get('/v1/clients'); return response.data; } /**