list_services
Discover all available services in your Home Assistant smart home system to control devices like lights, switches, and sensors.
Instructions
List all available Home Assistant services
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:231-241 (handler)The handler for the 'list_services' tool. It calls haClient.getServices() to fetch the services from Home Assistant API and returns the result as a JSON-formatted text content block.
case "list_services": { const services = await haClient.getServices(); return { content: [ { type: "text", text: JSON.stringify(services, null, 2), }, ], }; } - src/index.ts:153-160 (registration)Registration of the 'list_services' tool in the ListTools response, including name, description, and empty input schema (no parameters required).
{ name: "list_services", description: "List all available Home Assistant services", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:65-67 (helper)Helper method in HomeAssistantClient class that fetches the list of available services from the Home Assistant API endpoint '/api/services'.
async getServices() { return this.fetch("services"); } - src/index.ts:156-159 (schema)Input schema for the 'list_services' tool, which requires no parameters (empty properties).
inputSchema: { type: "object", properties: {}, },