Skip to main content
Glama

Replace energy dashboard source lists

energy_save_energy_prefs
DestructiveIdempotent

Replace the Energy Dashboard's full energy_sources or device_consumption lists in Home Assistant via the energy/save_prefs WebSocket call. Use when you already hold the complete desired list.

Instructions

Save Energy Dashboard preferences via WS energy/save_prefs.

Each of energy_sources/device_consumption you pass replaces the entire corresponding saved list — it is not merged with what's already there. Use energy_add_grid_consumption, energy_add_grid_return, energy_add_solar_source, energy_add_battery_source or energy_remove_energy_source for incremental edits instead of hand-building the full list. currency/energy_per_unit are kept only for backward compatibility and are rejected: HA's currency lives in core config (homeassistant.currency), not this WS schema, and energy_per_unit does not exist in it at all.

Use when: you already hold the full desired energy_sources/ device_consumption list, e.g. from energy_get_energy_prefs. Not for: adding or removing one source — use the energy_add_*/ energy_remove_energy_source helpers, which read-modify-write for you. Returns: {"status": "saved", "result": ..., "fields": [...]} on success. Errors: {"error": "no fields to save", ...} when both list parameters are omitted; {"error": "currency and energy_per_unit are not fields of HA's energy/save_prefs WS schema...", ...} when either deprecated parameter is passed; {"error": str(e), ...} when the WS call raises.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyNoDeprecated and not part of this WS schema; passing anything other than None now returns an error instead of being silently ignored. Omit this parameter.
energy_sourcesNoFull replacement for the Energy Dashboard's energy_sources list; each dict is one grid/solar/battery/gas/water source. Omit to leave the currently saved sources untouched.
energy_per_unitNoDeprecated and not part of this WS schema; passing anything other than None now returns an error instead of being silently ignored. Omit this parameter.
device_consumptionNoFull replacement for the Energy Dashboard's device_consumption list, one dict per tracked device. Omit to leave the currently saved device list untouched.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.25.1
    • addedInput schema / properties / currency / description
      Added value: +"Deprecated and not part of this WS schema; passing anything other than None now returns an error instead of being silently ignored. Omit this parameter."
    • addedInput schema / properties / device_consumption / description
      Added value: +"Full replacement for the Energy Dashboard's device_consumption list, one dict per tracked device. Omit to leave the currently saved device list untouched."
    • addedInput schema / properties / energy_per_unit / description
      Added value: +"Deprecated and not part of this WS schema; passing anything other than None now returns an error instead of being silently ignored. Omit this parameter."
    • addedInput schema / properties / energy_sources / description
      Added value: +"Full replacement for the Energy Dashboard's energy_sources list; each dict is one grid/solar/battery/gas/water source. Omit to leave the currently saved sources untouched."
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=true, but the description goes further by disclosing exactly WHAT is destroyed: each list parameter 'replaces the entire corresponding saved list — it is not merged.' It also documents the rejected deprecated parameters and their error outcomes. This is substantial behavioral context beyond the annotations.

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 operation and its core replacement semantics, then organizes alternatives, usage conditions, return shape, and error cases in clearly labeled blocks. It is longer than average, and the verbatim WS schema names plus full error-string enumeration are somewhat heavy, but every block serves selection or invocation.

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?

Although an output schema exists (so return values need not be explained), the description still states the success shape and the two specific error conditions. Combined with destructive/idempotent annotations and full schema coverage, an agent has everything needed to call this tool correctly and interpret failures.

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 the schema already documents each parameter's replacement-vs-omit behavior and the deprecated currency/energy_per_unit handling. The description reinforces the non-merge semantics and the rejection of deprecated fields, but adds no syntax or format detail beyond what the schema states. Baseline 3 applies when the schema does the heavy lifting.

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+resource ('Save Energy Dashboard preferences via WS energy/save_prefs') and immediately clarifies the replacement semantics, which is the defining characteristic of this tool. It also names the sibling helpers it must not be confused with, so an agent can distinguish it from the energy_add_*/energy_remove_energy_source tools without opening a schema.

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?

Contains explicit 'Use when' (you already hold the full desired lists, e.g. from energy_get_energy_prefs) and 'Not for' (single-source edits) sections, naming the concrete alternative tools for each case. Nothing about tool selection is left to inference.

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