Skip to main content
Glama
home-assistant-agent-mcp

home-assistant-agent-mcp

by Hemanthkolli

ha_render_template

Render Jinja2 template strings to test template output before using them in Home Assistant automations.

Instructions

Render a Jinja2 template string. Useful for testing templates before using them in automations.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "template": "<template>"
    },
    "name": "ha_render_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
templateYese.g. {{ states('sensor.outdoor_temperature') }}

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden. It never states that rendering is a non-mutating evaluation, whether the template can read live entity states, what happens on a Jinja2 syntax error, or that the result is a rendered string. For an evaluation tool with zero annotation coverage, these are meaningful omissions.

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?

Two short sentences with the action front-loaded and the motivating use case second. No padding or restated field names.

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?

For a one-parameter evaluation tool with a fully documented schema and no output schema, the description is workable but thin. It omits error behavior and the shape of the rendered result, which are the main things an agent needs to call it confidently without annotations.

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?

There is a single required parameter, and its schema description already includes a concrete example ({{ states('sensor.outdoor_temperature') }}) at 100% coverage, so the description adds no syntax or formatting guidance beyond it. The baseline of 3 applies when the schema does the work.

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 names a specific verb and resource: rendering a Jinja2 template string. That is clearly distinct from the CRUD-oriented siblings (ha_get_entity, ha_call_service, ha_list_automations), which never mention templating, though the description itself does not call out that distinction.

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

Usage Guidelines3/5

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

"Useful for testing templates before using them in automations" gives one implied scenario, but it does not say when this should be preferred over querying states directly, nor does it address whether templates run at runtime or only for preview.

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