Skip to main content
Glama
aderik

ha-automation-mcp

by aderik

upsert_template_entity

Create or update a Home Assistant template entity by name, defining its type and config; reloads the template domain so changes apply without hand-editing YAML.

Instructions

Create or update a template entity (reloads the template domain).

Args: template_type: One of sensor / binary_sensor / switch / button / number / select. name: Display name; also the unique key used for upsert. config: Template config (e.g. {"state": "{{ ... }}", "unit_of_measurement": "d", "icon": "mdi:sprout", "unique_id": "...", ...}).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
configYes
template_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose one meaningful behavioral trait — the template domain gets reloaded — and the 'upsert' semantics imply existing entities are overwritten. However, it says nothing about permissions, failure modes, or what happens to config keys not supplied.

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 one-line summary is front-loaded with the operation and its side effect, and the args block is tight and scannable. Every line earns its place; nothing is redundant.

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 mutation tool with no annotations and no output schema, the description covers inputs and the reload side effect adequately, but leaves the caller without any picture of success/failure behavior or what the upsert returns. It is workable but not complete.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate and largely does: template_type enumerates the six allowed values, name is identified as the unique upsert key, and config is illustrated with a concrete JSON example including state, unit_of_measurement, icon and unique_id. Only the config's full accepted key set remains open-ended.

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?

States a specific verb pair (create or update) and a specific resource (template entity), plus the side effect of reloading the template domain. It does not distinguish itself from nearby siblings such as upsert_helper or create_or_update_automation, so it falls short of a 5.

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 on when to use this versus upsert_helper, create_or_update_automation, or list_template_entities. The only contextual hint is the parenthetical about reloading the domain, which implies a heavier operation but is not framed as a when-to-use condition.

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