Skip to main content
Glama

Set energy mode

set_energy_mode
Destructive

Switch a solar site's energy mode or tune Ai+ settings, and schedule manual charge/discharge windows. Changes apply within a minute and require user confirmation.

Instructions

CHANGES THE SITE (control scope). Confirm with the user before calling.

Switch how the site is run (pass mode), or tune Ai+ without switching (omit mode, pass settings and/or variant). A rejected value changes nothing; rejected says why.

mode=forced is manual and time-boxed: the site returns to its previous mode when duration_minutes is up. Give action for one window starting now, or time_slots. Refused (409) while a strategy is running, or when an au_* mode cannot run on the site. Takes effect within about a minute; the SOC floor and export limits hold. On a demo site (sandbox:...) nothing reaches hardware.

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": {
      "site_id": "<site_id>"
    },
    "name": "set_energy_mode"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoHow to run the site: selfConsumption (inverter default); amber_smart (Ai+, price-driven trading); au_forecast_export, au_negative_price, au_smart_energy, au_weather_season (the AU-01..04 student strategies, described in get_agent_guide); forced (manual charge / discharge windows). Omitted = keep the mode and change Ai+ only.
actionNoforced: one window starting now and lasting duration_minutes. Use this or time_slots.
power_wNoWith action: the charge / discharge power in W.
site_idYesSite id from list_sites: vendor:station_id, e.g. sungrow:1445844.
variantNoAi+ engine variant, one of get_energy_mode `ai_plus.variant_options`: with mode=amber_smart the engine to switch to, without mode a change of engine in place.
settingsNoWithout mode: the Ai+ levers to change, names and ranges from get_energy_mode `ai_plus.tunable`. With an au_* mode: that strategy's own numbers, e.g. {"reserve_soc": 60}. Refused with mode=amber_smart.
stop_socNoWith action=discharge: stop discharging at this SOC, 0 to 100.
target_socNoWith action=charge: stop charging at this SOC, 0 to 100.
time_slotsNoforced: the windows, in site local time. Each is {"type": charge | discharge, "start": "HH:MM", "end": "HH:MM" (earlier than start = crosses midnight), "target_soc" (charge) or "stop_soc" (discharge), "power": W, "pace": true to spread a discharge so stop_soc is reached exactly at end}. plan_discharge returns them ready to pass.
duration_minutesNoWith mode: hand the site back to its previous mode after this many minutes, at most 1440. forced is always time-boxed (240 when omitted); other modes stay until changed unless this is given.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.11.5
    • changedInput schema / properties / action / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "charge",
      +      "discharge"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / action / description
      Added value: +"forced: one window starting now and lasting duration_minutes. Use this or time_slots."
    • addedInput schema / properties / duration_minutes / description
      Added value: +"With mode: hand the site back to its previous mode after this many minutes, at most 1440. forced is always time-boxed (240 when omitted); other modes stay until changed unless this is given."
    • addedInput schema / properties / mode / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "selfConsumption",
      +      "amber_smart",
      +      "au_forecast_export",
      +      "au_negative_price",
      +      "au_smart_energy",
      +      "au_weather_season",
      +      "forced"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / mode / default
      Added value: +null
    • addedInput schema / properties / mode / description
      Added value: +"How to run the site: selfConsumption (inverter default); amber_smart (Ai+, price-driven trading); au_forecast_export, au_negative_price, au_smart_energy, au_weather_season (the AU-01..04 student strategies, described in get_agent_guide); forced (manual charge / discharge windows). Omitted = keep the mode and change Ai+ only."
    • removedInput schema / properties / mode / type
      Removed value: -"string"
    • addedInput schema / properties / power_w / description
      Added value: +"With action: the charge / discharge power in W."
    • addedInput schema / properties / settings / description
      Added value: +"Without mode: the Ai+ levers to change, names and ranges from get_energy_mode `ai_plus.tunable`. With an au_* mode: that strategy's own numbers, e.g. {\"reserve_soc\": 60}. Refused with mode=amber_smart."
    • addedInput schema / properties / site_id / description
      Added value: +"Site id from list_sites: vendor:station_id, e.g. sungrow:1445844."
    • addedInput schema / properties / stop_soc / description
      Added value: +"With action=discharge: stop discharging at this SOC, 0 to 100."
    • addedInput schema / properties / target_soc / description
      Added value: +"With action=charge: stop charging at this SOC, 0 to 100."
    • addedInput schema / properties / time_slots / description
      Added value: +"forced: the windows, in site local time. Each is {\"type\": charge | discharge, \"start\": \"HH:MM\", \"end\": \"HH:MM\" (earlier than start = crosses midnight), \"target_soc\" (charge) or \"stop_soc\" (discharge), \"power\": W, \"pace\": true to spread a discharge so stop_soc is reached exactly at end}. plan_discharge returns them ready to pass."
    • addedInput schema / properties / variant / description
      Added value: +"Ai+ engine variant, one of get_energy_mode `ai_plus.variant_options`: with mode=amber_smart the engine to switch to, without mode a change of engine in place."
    • changedInput schema / required
      Previous value: -[
      -  "site_id",
      -  "mode"
      -]New value: +[
      +  "site_id"
      +]
  2. Changed1 schema field changedv0.11.4
    • addedInput schema / properties / settings
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Settings"
      +}
  3. First observedv0.9.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, and the description reinforces rather than contradicts them ('CHANGES THE SITE', confirm first). It adds genuinely new behavior: forced mode is time-boxed and reverts to the previous mode after duration_minutes, rejection is atomic ('a rejected value changes nothing' with a `rejected` reason), effects land within about a minute, SOC floor and export limits still apply, and sandbox sites never reach hardware. It stops short of describing exactly what gets overwritten for a non-forced, non-time-boxed mode change.

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-loading the mutation warning and the confirm-first rule before any parameter talk is the right ordering, and the mode/no-mode split is stated before the forced-mode detail. It is dense but nearly every clause carries a distinct constraint; a small amount of the forced-mode wording duplicates the schema's `time_slots`/`duration_minutes` text.

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 10-parameter destructive write tool this covers what an agent needs: confirmation requirement, the two invocation shapes, refusal conditions, timing of effect, duration semantics and sandbox behavior. Return values need not be explained since an output schema exists, and the one relevant error signal (`rejected`) is named.

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%, so the baseline is 3; the description earns a bump by stating cross-parameter rules the per-field text scatters: mode vs. settings/variant are mutually exclusive paths, `settings` is refused with mode=amber_smart, and forced is always time-boxed (240 minutes when duration_minutes is omitted) while other modes persist until changed. Remaining overlap with schema descriptions keeps it from a 5.

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 line states a specific verb and resource ('Switch how the site is run') and immediately disambiguates the tool's two operating shapes: switching mode by passing `mode`, versus tuning Ai+ in place by omitting it. 'CHANGES THE SITE (control scope)' separates it from read-side siblings such as get_energy_mode, which is referenced only as a value source.

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?

Explicit when-to-use branches are given (mode vs. no-mode; `action` for a window starting now vs. `time_slots` for scheduled ones), plus an exclusion: refused (409) while a strategy is running, i.e. end the strategy first. It also routes agents to plan_discharge for pre-built slots and to get_energy_mode for valid values, and mandates user confirmation before calling.

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