get_door
Retrieve access door information from UniFi network infrastructure to monitor and manage entry points through the Cloud API.
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": "get_door"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/access.js:28-33 (handler)Handler function for the 'get_door' tool that retrieves specific door details from the UniFi API and returns formatted JSON response.
handler: async ({ hostId, doorId }) => { const door = await unifi.getDoor(hostId, doorId); return { content: [{ type: 'text', text: JSON.stringify(door, null, 2) }] }; } - src/tools/access.js:24-27 (schema)Zod schema defining input parameters for the 'get_door' tool: hostId and doorId.
schema: z.object({ hostId: z.string().describe('The host ID'), doorId: z.string().describe('The door ID') }), - src/server.js:32-32 (registration)Registers the accessTools module, which includes the 'get_door' tool, with the MCP server using registerToolsFromModule.
registerToolsFromModule(accessTools); - src/unifi-client.js:261-264 (helper)Helper function getDoor that makes the API call to retrieve door details from UniFi Cloud API, called by the tool handler.
export async function getDoor(hostId, doorId) { const response = await cloudApi.get(`/v1/hosts/${hostId}/doors/${doorId}`); return response.data; }