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.
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": "ha_list_areas"
}
}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') }