unifi_health
Check and monitor the health status of your UniFi network infrastructure to identify issues and ensure optimal performance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/network.js:12-17 (handler)The MCP tool handler for 'unifi_health'. It invokes unifi.healthCheck() from the client library and formats the result as MCP content.handler: async () => { const health = await unifi.healthCheck(); return { content: [{ type: 'text', text: JSON.stringify(health, null, 2) }] }; }
- src/tools/network.js:11-11 (schema)The Zod input schema for 'unifi_health', which accepts no parameters.schema: z.object({}),
- src/server.js:28-28 (registration)Registers the networkTools module, which includes the 'unifi_health' tool, with the MCP server.registerToolsFromModule(networkTools);
- src/unifi-client.js:291-308 (helper)Helper function that checks UniFi Cloud API connectivity by listing hosts and returns health status.export async function healthCheck() { try { const hosts = await listHosts(); return { ok: true, timestamp: new Date().toISOString(), hostsCount: hosts.data?.length || 0, apiBase: CLOUD_API_BASE }; } catch (error) { return { ok: false, timestamp: new Date().toISOString(), error: error.message, apiBase: CLOUD_API_BASE }; } }