Skip to main content
Glama
Vortitron

home-assistant-mcp

by Vortitron

Get automation/script trace

ha_get_trace
Read-only

Explain why an automation or script run failed: return step-by-step trigger, condition, action results, and the first failing step for the latest or specified run.

Instructions

Step-by-step detail for one run: what triggered it, every condition and action in order with its result, and 'failed_at' naming the first step that errored or evaluated false. This is the tool for 'why didn't my automation run' — logs usually stay silent about a condition returning false. Give 'item' and omit run_id for its most recent run, or give a run_id from ha_list_traces (item is then optional — the run's own item is looked up). Summarised by default; set full=true for the raw trace including the config (large).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullNoReturn the raw, unsummarised trace including the item's config (default false).
itemNoentity_id or unique id (automation.x / the unique id; script.y / y). Required unless run_id is given.
domainNoItem kind (default 'automation').
run_idNoSpecific run to fetch (default: the latest).
instance_idNoOptional: the instance you mean (as listed by vomehome_list_instances). When given, the call is refused if this session is targeting a different home, instead of answering from it.
include_variablesNoInclude each step's changed variables (default false — verbose).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.10.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already establish read-only/open-world. The description adds real behavioral context beyond them: output is summarised by default, full=true returns the raw trace including config and is 'large', and it explains that logs stay silent about false conditions. It doesn't cover pagination or error behavior, but that is minor against the annotation coverage.

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?

Front-loads the return-shape summary, then the use case, then the argument rules. Roughly four dense sentences with no filler, though it is on the longer side for a single-get tool and could trim the 'why didn't my automation run' aside slightly.

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

Completeness4/5

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

With no output schema, the description carries the burden of describing returns and does so well: trigger, ordered conditions/actions, results, and failed_at. The summarised-vs-full distinction is covered. It stops short of describing the shape of the summarised payload or error cases, leaving a small gap.

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 100% (baseline 3), but the description goes further by explaining the interaction semantics: give item and omit run_id for the latest run, or give run_id and item becomes optional because the run's own item is looked up. That relational behavior is not spelled out in the schema and adds genuine value.

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

Purpose5/5

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

States a specific verb and resource ('Get', trace) and enumerates what one run's output contains: trigger, ordered conditions/actions with results, and 'failed_at'. It distinguishes itself from the sibling ha_list_traces by being the drill-down for a single run while that tool enumerates runs.

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

Usage Guidelines5/5

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

Explicitly routes the agent: 'This is the tool for why didn't my automation run', and names ha_list_traces as the source of run_id. It gives concrete when-to-use rules for the item vs run_id combination, so there is no ambiguity about which argument to supply in which situation.

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

Deploy Server

Other Tools