find_door_by_name
Locate and retrieve specific access door details within UniFi network infrastructure by using its name, enabling targeted management and control.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/access.js:91-111 (handler)The handler function implements the core logic: fetches all doors via unifi.listDoors, filters by name containing the query (case-insensitive), and returns JSON with matches.
handler: async ({ hostId, query }) => { const queryLower = query.toLowerCase(); const doorsResponse = await unifi.listDoors(hostId); const doors = doorsResponse.data || []; const matches = doors.filter(d => { const name = (d.name || '').toLowerCase(); return name.includes(queryLower); }); return { content: [{ type: 'text', text: JSON.stringify({ searchQuery: query, matchCount: matches.length, matches }, null, 2) }] }; } - src/tools/access.js:87-90 (schema)Zod schema defining input parameters: hostId (string) and query (string).
schema: z.object({ hostId: z.string().describe('The host ID'), query: z.string().describe('The search query for door name') }), - src/server.js:32-32 (registration)Registers all tools from the accessTools module (including find_door_by_name) with the MCP server using registerToolsFromModule.
registerToolsFromModule(accessTools); - src/server.js:6-6 (registration)Import of the accessTools module containing the find_door_by_name tool definition.
import { accessTools } from './tools/access.js';