Skip to main content
Glama
hekmon8

Home Assistant MCP Server

by hekmon8

trigger_automation

Execute Home Assistant automations by specifying the automation ID to control devices and routines in your smart home.

Instructions

Trigger a Home Assistant automation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
automation_idYesThe automation ID to trigger (e.g., automation.morning_routine)

Implementation Reference

  • The main execution logic for the 'trigger_automation' tool. Validates input, calls Home Assistant API to trigger the specified automation, and returns success response.
    private async triggerAutomation(args: any) {
      if (!args.automation_id) {
        throw new McpError(ErrorCode.InvalidParams, 'automation_id is required');
      }
    
      const response = await this.haClient.post('/api/services/automation/trigger', {
        entity_id: args.automation_id,
      });
    
      return {
        content: [
          {
            type: 'text',
            text: `Successfully triggered ${args.automation_id}`,
          },
        ],
      };
    }
  • JSON Schema defining the input parameters for the tool: requires 'automation_id' as a string.
    inputSchema: {
      type: 'object',
      properties: {
        automation_id: {
          type: 'string',
          description: 'The automation ID to trigger (e.g., automation.morning_routine)',
        },
      },
      required: ['automation_id'],
    },
  • src/index.ts:89-102 (registration)
    Registration of the tool in the 'list_tools' response, including name, description, and schema.
    {
      name: 'trigger_automation',
      description: 'Trigger a Home Assistant automation',
      inputSchema: {
        type: 'object',
        properties: {
          automation_id: {
            type: 'string',
            description: 'The automation ID to trigger (e.g., automation.morning_routine)',
          },
        },
        required: ['automation_id'],
      },
    },
  • src/index.ts:126-127 (registration)
    Dispatch/route in the 'call_tool' request handler that maps tool name to the handler function.
    case 'trigger_automation':
      return await this.triggerAutomation(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'trigger' implies an action that may have side effects (e.g., starting an automation sequence), the description doesn't specify whether this requires authentication, what happens if the automation fails, or if there are rate limits. It lacks critical context for a mutation tool.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple tool with one parameter. Every word earns its place.

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

Completeness2/5

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

Given the tool's complexity (a mutation operation with potential side effects), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, response format, or prerequisites, leaving significant gaps for the agent to navigate.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'automation_id' fully documented in the schema. The description doesn't add any parameter details beyond what the schema provides (e.g., it doesn't explain how to find automation IDs or provide examples beyond the schema's example). Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('trigger') and the resource ('a Home Assistant automation'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its siblings (get_state, list_entities, toggle_entity) which all operate on different resources, so it doesn't fully distinguish itself in context.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid automation ID), when not to use it, or how it differs from sibling tools like toggle_entity. The agent must infer usage from the tool name alone.

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/hekmon8/Homeassistant-server-mcp'

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