list_sites
Retrieve a list of managed sites from UniFi network infrastructure to view and organize network deployments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/network.js:66-71 (handler)Tool handler for list_sites: fetches sites using unifi.listSites() and returns JSON stringified response in MCP format.handler: async () => { const sites = await unifi.listSites(); return { content: [{ type: 'text', text: JSON.stringify(sites, null, 2) }] }; }
- src/tools/network.js:65-65 (schema)Zod schema for list_sites tool inputs: accepts no parameters (empty object).schema: z.object({}),
- src/server.js:28-28 (registration)Registers the networkTools module (including list_sites) with the MCP server via registerToolsFromModule function.registerToolsFromModule(networkTools);
- src/unifi-client.js:69-72 (helper)Core helper function that performs the UniFi Cloud API GET request to /v1/sites to retrieve all sites.export async function listSites() { const response = await cloudApi.get('/v1/sites'); return response.data; }