Skip to main content
Glama

Discharge plan

plan_discharge
Read-onlyIdempotent

Calculates when and how hard to discharge a battery: sell energy in best-paid intervals above reserve SOC, or discharge steadily to hit a target SOC by a set time.

Instructions

Work out when and how hard to discharge. Calculates only: nothing is applied, a read key is enough.

goal='best_price' ("sell at the best prices tonight"): the best-paid Amber intervals between window_start and window_end for the energy above reserve_soc, optionally only above min_sell_c. Returns the intervals, expected revenue and the average it beats.

goal='target_soc' ("keep 30% for 9 pm"): one steady discharge from window_start (default now) that reaches target_soc at window_end; needs both of those; prices play no part. Returns power_w.

Both return proposed time_slots: apply with set_energy_mode(mode='forced', time_slots=...) after the user agrees. On hosts with cards the plan's Apply button is the user's yes.

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>",
      "goal": "<goal>"
    },
    "name": "plan_discharge"
  }
}

Input Schema

NameRequiredDescriptionDefault
goalYesbest_price = sell in the best-paid Amber intervals; target_soc = one steady discharge that ends at a chosen SOC.
site_idYesSite id from list_sites: vendor:station_id, e.g. sungrow:1445844.
min_sell_cNobest_price only: sell only in intervals paying more than this, c/kWh.
target_socNotarget_soc only, and required there: the SOC to be at by window_end, 0 to 100.
window_endNoHH:MM site local. best_price: where the selling window ends. target_soc: the time to be at target_soc (required).
reserve_socNobest_price only: the SOC to keep, 0 to 100; only energy above it is sold.
window_startNoHH:MM site local. best_price: where the selling window starts. target_soc: when to start discharging (omitted = now).
battery_capacity_kwhNoBattery capacity to calculate with, kWh. Normally omitted: the site's own figure is used.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.5

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description reinforces this with 'nothing is applied, a read key is enough', which adds an auth requirement the annotations cannot express. It also discloses the mutation path (set_energy_mode) and the human-approval condition, both beyond structured fields.

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-loaded with the core purpose and the read-only caveat before the per-goal detail, which is the right ordering. It is dense with parenthetical user phrasings and some redundancy ('needs both of those'), but no sentence is wasted.

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 an 8-parameter tool with two modes, an output schema, and a downstream apply step, the description covers both branches, their required inputs, what comes back (time_slots, revenue, power_w), and how to act on it. Nothing an agent needs to call this correctly is missing.

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 more by documenting cross-parameter conditionality the schema only hints at — which optional fields are best_price only (min_sell_c, reserve_soc, window_end) versus required for target_soc, and that prices play no part in the target path. It does not add format detail for HH:MM or capacity beyond the schema.

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 states a specific verb and outcome ('Work out when and how hard to discharge') and immediately disclaims scope: 'Calculates only: nothing is applied.' The two enum goals are each named and described in user-facing terms ('sell at the best prices tonight', 'keep 30% for 9 pm'), so an agent can map intent to goal without opening the 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?

Explicit branch conditions for each goal, including prerequisites ('needs both of those' for target_soc, window_start defaulting to now). It also names the follow-up action and its approval gate: apply with set_energy_mode(mode='forced', time_slots=...) after the user agrees, with the Apply-button variant on card hosts.

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