Skip to main content
Glama
HiTechLabTN

hass-mcp

by HiTechLabTN

get_error_log

Retrieve and filter Home Assistant error logs to troubleshoot issues. Use optional filters for log level, integration, or search terms to isolate relevant errors.

Instructions

Get the Home Assistant error log for troubleshooting.

All filters are optional and combine (AND semantics). Stats (error_count, warning_count, integration_mentions, total_lines) are computed over the filtered output so they match what's returned.

Args: level: Filter to lines containing this log level — ERROR, WARNING, INFO, or DEBUG. Case-insensitive. integration: Filter to lines mentioning this integration. Matches [name] or [homeassistant.components.name]. Case-insensitive. search_term: Case-insensitive substring filter applied per line. Useful for entity IDs, exception names, etc. lines: Return only the most recent N lines (applied after other filters). Useful when you only care about the tail.

Returns: A dictionary containing: - log_text: The (possibly filtered) error log text - error_count: Number of ERROR entries in the filtered output - warning_count: Number of WARNING entries in the filtered output - integration_mentions: Map of integration names to mention counts - total_lines: Number of lines in the filtered output - filters_applied: Map of which filter args were supplied - error: Error message if retrieval failed

Examples: get_error_log() # full log get_error_log(level="ERROR") # errors only get_error_log(integration="zwave_js") # one integration get_error_log(search_term="light.kitchen") # specific entity get_error_log(level="ERROR", lines=50) # last 50 errors

Best Practices: - Filter on the server side (here) rather than pulling the full log into Claude's context — saves tokens on noisy logs. - Combine integration + level="ERROR" to triage a single integration that's misbehaving. - Use lines to bound output when scanning a long-running HA.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNo
linesNo
integrationNo
search_termNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With NO annotations, the full burden falls on the description — and it delivers. Key subtleties are disclosed: 'All filters are optional and combine (AND semantics)', and stats 'are computed over the filtered output so they match what's returned' (prevents the classic off-by-one confusion of counts vs. full log). Case-insensitivity is noted per filter, the return dict is fully documented including the `error` key for failure, and the Examples clarify default behavior with no args.

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?

Perfectly front-loaded single sentence, then a logical docstring structure: semantics → Args → Returns → Examples → Best Practices. Every section earns its place — the 'AND semantics' and 'computed over the filtered output' notes are exactly the kind of non-obvious detail an agent needs. It's long, but at this density, the length is information-carrying, not waste.

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

Completeness5/5

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

For a 4-optional-param read-only tool, the coverage is exhaustive: parameter semantics, return-value structure, error key, and 5 concrete usage examples. Covers edge considerations like token efficiency when scanning long-running HAs. Given a documented return schema (output_schema exists) the returns section reaffirms rather than compensates. The only marginal gaps (e.g., rate limits, auth scope) are not applicable to a local log reader.

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

Parameters5/5

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

Schema description coverage is 0% (types only), so the description was required to compensate — and it does so comprehensively. Each of the 4 parameters is documented with its valid values (``ERROR, WARNING, INFO, or DEBUG``), matching patterns (``[name]`` or ``[homeassistant.components.name]``), case-insensitivity, and ordering semantics ('applied after other filters'). The 'Examples' section demonstrates useful combinations and the Examples make the semantics concrete. This is a model of how to document params when the schema is uninformative.

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?

The opening sentence — 'Get the Home Assistant error log for troubleshooting' — uses a specific verb (Get) + specific resource (Home Assistant error log) + clear purpose (troubleshooting). The description clearly separates this from sibling tools like get_history, get_statistics, and list_entities. No ambiguity about what this tool does.

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 Best Practices section gives actionable runtime guidance: server-side filtering 'to save tokens on noisy logs,' a triage pattern ('Combine integration + level="ERROR"'), and bounding output with `lines`. However, it never explicitly names alternatives or tells the agent when NOT to use this tool versus a sibling like get_history. Strong parameter-usage guidance, but no 'when to use alternative X instead' framing.

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/HiTechLabTN/hass-mcp'

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