Skip to main content
Glama
Home Assistant MCP Server

Home Assistant MCP Server

by rilhia

Get automation trace

get_automation_trace
Read-onlyIdempotent

Inspect past automation runs to diagnose failures, list recent runs, identify the last step reached, node errors, failed conditions, and get a plain English diagnosis.

Instructions

Inspect past runs of an automation to diagnose failures. Without run_id it lists recent runs and details the most recent one. Reports the last step reached, node level errors, failed conditions and a plain English diagnosis.

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": {
      "automation_id": "<automation_id>"
    },
    "name": "get_automation_trace"
  }
}

Input Schema

NameRequiredDescriptionDefault
run_idNoA specific run id from the run list. Defaults to the most recent run.
runs_limitNoHow many recent runs to list.
only_failedNoPick the most recent run that did not finish cleanly.
automation_idYesThe automation config id or entity id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is covered; the description goes further by disclosing the dual-mode behavior (lists recent runs and details the most recent when run_id is omitted). It also enumerates what the trace reports — last step reached, node-level errors, failed conditions, plain-English diagnosis — which matters because no output schema exists.

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?

Three short sentences, purpose front-loaded, then the mode behavior, then the payload contents. No filler and nothing repeated from the schema verbatim.

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?

For a read-only, four-parameter tool with no output schema, the description covers intent, mode switching, and the shape of the returned diagnosis. It could be marginally stronger by noting that the run list is bounded by runs_limit or by pointing to get_logbook for raw logs, but nothing essential to correct invocation is missing.

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%, so all four parameters are already documented, and the description largely restates run_id's default behavior that the schema states. It adds a little by framing the omission of run_id as producing a run list plus the latest detail, but says nothing about runs_limit or only_failed beyond what the schema provides. Baseline 3 is appropriate.

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 and resource ('Inspect past runs of an automation') plus the goal ('to diagnose failures'), which is far more than a restatement of the name. It doesn't explicitly name the closest sibling, get_script_trace, so an agent must infer the automation-vs-script split from the resource name alone.

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

Usage Guidelines4/5

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

The opening clause gives a clear use case (failure diagnosis) and the second sentence explains the two calling modes — list-only versus run-detail — so the agent knows what happens with and without run_id. There is no explicit when-not guidance or mention of when to prefer get_automation or get_logbook instead.

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