list_sites
Retrieve a list of managed sites from UniFi network infrastructure to view and organize network deployments.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_sites"
}
}Input 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; }