Skip to main content
Glama

Home Assistant MCP Server

states.ts1.18 kB
import { z } from "zod"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { HassClient } from "../../api/client.js"; export function registerEntitiesStatesPrompt(server: McpServer, _client: HassClient) { server.prompt( "entities-states", "Get the current states of multiple Home Assistant entities", { entity_ids: z.string().describe("Comma-separated list of entity IDs to get states for"), }, async (request) => { // Return a prompt message sequence return { messages: [ { role: "user", content: { type: "text", text: `What are the states of these entities: ${request.entity_ids}?`, }, }, { role: "assistant", content: { type: "text", text: "I'll check the states of those entities for you.", }, }, { role: "user", content: { type: "text", text: "Please use the entities states tool to get the current states.", }, }, ], }; }, ); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oleander/home-assistant-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server