ha_list_areas
List all areas registered in Home Assistant to organize and reference your zones.
Instructions
List Home Assistant areas from the area registry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:97-106 (handler)Registers the 'ha_list_areas' tool handler which calls ha.listAreas() and returns the result as JSON text.
server.tool( 'ha_list_areas', 'List Home Assistant areas from the area registry.', ListAreasInput.shape, async () => { const areas = await ha.listAreas() return { content: [{ type: 'text', text: JSON.stringify(areas, null, 2) }], } }, - src/tools.ts:14-14 (schema)Defines the empty input schema for the ha_list_areas tool (no parameters required).
export const ListAreasInput = z.object({}).strict() - src/index.ts:97-106 (registration)Registration of the 'ha_list_areas' tool on the MCP server using server.tool().
server.tool( 'ha_list_areas', 'List Home Assistant areas from the area registry.', ListAreasInput.shape, async () => { const areas = await ha.listAreas() return { content: [{ type: 'text', text: JSON.stringify(areas, null, 2) }], } }, - src/ha.ts:111-113 (helper)The helper method on HomeAssistantClient that calls the Home Assistant WebSocket API 'config/area_registry/list' to fetch areas.
async listAreas() { return await this.wsCall('config/area_registry/list') }