ha_list_services
List Home Assistant services and their fields to discover available actions for automations and scripts.
Instructions
List Home Assistant services and their fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:85-95 (handler)The MCP tool registration and handler for 'ha_list_services'. It uses an empty input schema, calls ha.listServices(), and returns the services JSON.
server.tool( 'ha_list_services', 'List Home Assistant services and their fields.', ListServicesInput.shape, async () => { const services = await ha.listServices() return { content: [{ type: 'text', text: JSON.stringify(services, null, 2) }], } }, ) - src/tools.ts:17-17 (schema)The Zod schema for ha_list_services input — an empty strict object (no parameters accepted).
export const ListServicesInput = z.object({}).strict() - src/index.ts:85-95 (registration)Registration of the tool named 'ha_list_services' on the MCP server via server.tool().
server.tool( 'ha_list_services', 'List Home Assistant services and their fields.', ListServicesInput.shape, async () => { const services = await ha.listServices() return { content: [{ type: 'text', text: JSON.stringify(services, null, 2) }], } }, ) - src/ha.ts:106-109 (helper)The HomeAssistantClient.listServices() method that connects via WebSocket and delegates to the home-assistant-js-websocket getServices() function.
async listServices() { const connection = await this.ensureConnected() return await getServices(connection) }