Skip to main content
Glama

Add solar production source

energy_add_solar_source

Register a solar production sensor as a new Home Assistant Energy Dashboard source by appending it to current energy preferences and saving the update.

Instructions

Add a solar production source to the Energy Dashboard.

Reads the current preferences, appends a new {"type": "solar", ...} entry to the energy_sources list, and saves it via WS energy/save_prefs. Calling it twice with the same stat_energy_from adds a second, duplicate source.

Use when: registering a solar production sensor as a new Energy Dashboard source. Not for: an existing source's export flow — use energy_add_grid_return; for a full source-list replacement use energy_save_energy_prefs. Returns: {"status": "added", "stat_energy_from": ..., "result": ...}. Errors: {"error": str(e), "stat_energy_from": ...} when either WS call raises.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stat_energy_fromYesStatistic/entity ID of the solar production sensor to add, e.g. 'sensor.solar_production'. Discover candidates with `statistics_list_statistic_ids`.
config_entry_solar_forecastNoOptional config entry ID of a solar forecast integration (e.g. Forecast.Solar) to link to this source. Omit if no forecast should be linked.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.25.1
    • addedInput schema / properties / config_entry_solar_forecast / description
      Added value: +"Optional config entry ID of a solar forecast integration (e.g. Forecast.Solar) to link to this source. Omit if no forecast should be linked."
    • addedInput schema / properties / stat_energy_from / description
      Added value: +"Statistic/entity ID of the solar production sensor to add, e.g. 'sensor.solar_production'. Discover candidates with `statistics_list_statistic_ids`."
  2. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations: it reveals the read-append-save implementation (energy/save_prefs), the exact entry shape appended, the duplicate-source behavior on repeated calls (reinforcing idempotentHint=false with concrete consequence), plus the return payload and error shape. Annotations cover the safety profile and destruction behavior, and the description adds material operational context on top.

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?

Front-loads the purpose, then behavior, then use/not-for routing, then returns/errors in clearly delineated blocks. Every sentence carries distinct information with no padding.

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?

Despite an output schema existing, the description still summarizes the success and error returns. Behavior, routing, prerequisites for the statistic ID, and outcome are all covered, so an agent has everything needed to call it correctly.

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 both parameters are already documented in the schema, including the meaning of stat_energy_from and the discovery path. The description adds only the duplicate-on-repeat note tied to stat_energy_from, so the baseline 3 applies.

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 ('Add a solar production source to the Energy Dashboard') and explicitly names the two siblings it must not be confused with (energy_add_grid_return, energy_save_energy_prefs). An agent can distinguish it without opening any 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?

Provides explicit 'Use when' and 'Not for' clauses, naming the exact alternative for each excluded case (export flow -> energy_add_grid_return; full replacement -> energy_save_energy_prefs). Routing is unambiguous.

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