Skip to main content
Glama

Preview or start strategy

start_strategy
Destructive

Preview and start custom solar battery strategies from ordered rules: dry-run on current readings returns a proposal ID, then confirm to activate or replace a running one.

Instructions

Preview or start a custom strategy: YOU write the rules from what the person wants. Two calls, the second needs the first.

  1. accept_risk=false (default): starts nothing; dry-runs the rules on the current readings and returns a proposal_id. A card host shows a Start button that makes call 2 itself, so wait; otherwise read the rules back and ask.

  2. accept_risk=true with that proposal_id and every other argument unchanged, only after the person said yes (control scope; demo sites dry-run). Refused without a matching proposal_id or after 15 minutes: preview again.

A strategy already running has its rules replaced by the same two calls.

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": "<name>",
      "rules": "<rules>"
    },
    "name": "start_strategy"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesShort name for the strategy, up to 100 characters.
rulesYesThe rules, checked in order; first match wins. At most 20 rules, 4 conditions each (all must hold). Each rule is {"when": [conditions], "then": action, "note": "why, in the person's words"}. A condition is {"metric": soc | import_price | export_price | hour, "operator": above | below | between, "value": n}; between takes "low" and "high" instead of "value". soc is %, prices are c/kWh for the current interval, hour is site local time as a decimal (17.5 = 5:30 pm; low > high wraps midnight). An action is {"action": charge | discharge | hold | auto, "power_w"?, "target_soc"? (charge), "stop_soc"? (discharge)}.
site_idYesSite id from list_sites: vendor:station_id, e.g. sungrow:1445844.
summaryNoWhat the strategy does, in a paragraph for the person to read; up to 600 characters.
fallbackNoThe action when no rule matches, shaped like a rule's `then`. Omitted = {"action": "auto"}.
accept_riskNofalse = preview only, nothing starts. true = start what was previewed, only after the person said yes.
proposal_idNo`proposal_id` from the preview of these same arguments; needed with accept_risk=true.
duration_minutesNoThe lease: how long the strategy runs, 15 to 10080 minutes. A new strategy runs for a day when omitted; a running one keeps its lease unless this is given.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changedv0.11.5
    • addedInput schema / properties / accept_risk / default
      Added value: +false
    • addedInput schema / properties / accept_risk / description
      Added value: +"false = preview only, nothing starts. true = start what was previewed, only after the person said yes."
    • addedInput schema / properties / duration_minutes / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / duration_minutes / default
      Previous value: -1440New value: +null
    • addedInput schema / properties / duration_minutes / description
      Added value: +"The lease: how long the strategy runs, 15 to 10080 minutes. A new strategy runs for a day when omitted; a running one keeps its lease unless this is given."
    • removedInput schema / properties / duration_minutes / type
      Removed value: -"integer"
    • addedInput schema / properties / fallback / description
      Added value: +"The action when no rule matches, shaped like a rule's `then`. Omitted = {\"action\": \"auto\"}."
    • addedInput schema / properties / name / description
      Added value: +"Short name for the strategy, up to 100 characters."
    • addedInput schema / properties / proposal_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "`proposal_id` from the preview of these same arguments; needed with accept_risk=true.",
      +  "title": "Proposal Id"
      +}
    • addedInput schema / properties / rules / description
      Added value: +"The rules, checked in order; first match wins. At most 20 rules, 4 conditions each (all must hold). Each rule is {\"when\": [conditions], \"then\": action, \"note\": \"why, in the person's words\"}. A condition is {\"metric\": soc | import_price | export_price | hour, \"operator\": above | below | between, \"value\": n}; between takes \"low\" and \"high\" instead of \"value\". soc is %, prices are c/kWh for the current interval, hour is site local time as a decimal (17.5 = 5:30 pm; low > high wraps midnight). An action is {\"action\": charge | discharge | hold | auto, \"power_w\"?, \"target_soc\"? (charge), \"stop_soc\"? (discharge)}."
    • addedInput schema / properties / site_id / description
      Added value: +"Site id from list_sites: vendor:station_id, e.g. sungrow:1445844."
    • addedInput schema / properties / summary / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / summary / default
      Previous value: -""New value: +null
    • addedInput schema / properties / summary / description
      Added value: +"What the strategy does, in a paragraph for the person to read; up to 600 characters."
    • removedInput schema / properties / summary / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "site_id",
      -  "name",
      -  "rules",
      -  "accept_risk"
      -]New value: +[
      +  "site_id",
      +  "name",
      +  "rules"
      +]
  2. Addedv0.11.4

TDQS

A4.6/5.0
Behavior4/5

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

The annotations already flag destructiveHint=true, openWorldHint=true and non-idempotence, but the description adds genuinely non-redundant behavior: preview starts nothing, the proposal expires after 15 minutes, a mismatch in arguments or missing proposal_id causes refusal, and an existing strategy's rules are replaced. It does not explain how long a refusal lasts or what the preview response contains, but the output schema covers returns.

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 core distinction in one line, then numbers the two modes so the ordering is obvious; almost no filler. A few fragments ('control scope; demo sites dry-run') are compressed to the point of being cryptic on first read, which costs it a point.

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 destructive, open-world, two-phase tool with 8 parameters, the description covers the sequence, the safety gate, refusal conditions, lease behavior and the already-running case, and an output schema exists to explain what comes back. Nothing essential to calling it 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 an extra point by documenting a cross-parameter constraint the schema cannot express — proposal_id must come from a preview of the same arguments with every other argument unchanged, and accept_risk=true is refused otherwise. It adds little to name/rules/summary beyond what the schema already says.

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 gives a specific verb and resource ('Preview or start a custom strategy') and immediately clarifies the unusual division of labor ('YOU write the rules'), which is exactly what an agent needs to know before picking this over get_strategy or end_strategy. The two numbered modes make the distinct behaviors of a single tool unambiguous.

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?

It spells out a mandatory two-call sequence, when each mode applies, and the gating condition for the second call ('only after the person said yes'), plus the card-host case where call 2 happens elsewhere so the agent should wait. It also names the fallback path when refused and the rule-replacement case for an already-running strategy, leaving little to inference.

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