Skip to main content
Glama
TheWhykiki

hass-mcp

by TheWhykiki

ha_light_turn_on

Turn on a light in Home Assistant by providing its entity ID.

Instructions

Turn on a light by entity_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYes

Implementation Reference

  • src/index.ts:133-143 (registration)
    Registration of the 'ha_light_turn_on' tool via server.tool(), with name, description, schema, and handler.
    server.tool(
      'ha_light_turn_on',
      'Turn on a light by entity_id.',
      TurnOnLightInput.shape,
      async (input) => {
        const res = await ha.callService('light', 'turn_on', { entity_id: input.entity_id })
        return {
          content: [{ type: 'text', text: JSON.stringify(res, null, 2) }],
        }
      },
    )
  • Handler function that calls ha.callService('light', 'turn_on', { entity_id: input.entity_id }) and returns the result.
      async (input) => {
        const res = await ha.callService('light', 'turn_on', { entity_id: input.entity_id })
        return {
          content: [{ type: 'text', text: JSON.stringify(res, null, 2) }],
        }
      },
    )
  • Zod schema definition for TurnOnLightInput — accepts a required entity_id string.
    export const TurnOnLightInput = z.object({
      entity_id: z.string().min(1),
    })
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose behavioral traits. It only states the obvious action and does not mention side effects, error conditions (e.g., invalid entity_id), or prerequisites (e.g., entity must be a light).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no wasted words. However, it is underspecified for a tool with no annotations, limiting its effectiveness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (turn on a light), the description is minimally complete. However, it lacks details on entity domain, return behavior, and integration with Home Assistant, and the absence of output schema or annotations leaves gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'by entity_id' but adds little meaning beyond the schema's parameter name and type. It does not explain the format or where to obtain the entity_id, and schema description coverage is 0%, so compensation is needed but not provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (turn on) and resource (light), and specifies the input method (by entity_id). It distinguishes from sibling tools like ha_light_turn_off and ha_area_lights_on, but does not explicitly contrast or provide scope details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like ha_area_lights_on or ha_light_turn_off. The description lacks any when-to-use or when-not-to-use context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/TheWhykiki/hass-mcp'

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