get_clients_for_site
Retrieve connected client devices from a UniFi network site to monitor network usage and manage access.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/clients.js:39-44 (handler)The MCP tool handler for 'get_clients_for_site' that invokes the UniFi API helper and returns formatted JSON response.handler: async ({ hostId, siteId }) => { const clients = await unifi.getClientsForSite(hostId, siteId); return { content: [{ type: 'text', text: JSON.stringify(clients, null, 2) }] }; }
- src/tools/clients.js:35-38 (schema)Zod input schema validating hostId and siteId parameters.schema: z.object({ hostId: z.string().describe('The host ID'), siteId: z.string().describe('The site ID') }),
- src/server.js:30-30 (registration)Registers the clientTools object (containing get_clients_for_site) with the MCP server via registerToolsFromModule.registerToolsFromModule(clientTools);
- src/unifi-client.js:141-144 (helper)Helper function in unifi-client that performs the actual UniFi Cloud API GET request for site clients.export async function getClientsForSite(hostId, siteId) { const response = await cloudApi.get(`/v1/hosts/${hostId}/sites/${siteId}/clients`); return response.data; }