Skip to main content
Glama

Add alert

create_alert

Set up a threshold alert for a solar or battery site so the app notifies the inbox and phone, and optionally emails, when the watched metric crosses a value.

Instructions

Set up a threshold alert on a site: it fires when the watched metric crosses the threshold. Every firing goes to the app inbox (and the phone when the app is installed); email=True also mails the account's verified address (list_sites account.email_alerts says whether that works). An alert only tells the person something; it never changes what the battery does. Confirm the rule with the user before creating it (or let them add it from the list_alerts card). Returns the site's rules with the new one under created.

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>",
      "metric": "<metric>",
      "operator": "<operator>",
      "threshold": "<threshold>"
    },
    "name": "create_alert"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesTitle shown on the alert, up to 100 characters. An empty string = one is made from the rule ("SOC below 20%").
emailNoAlso mail the account's verified address on each firing.
localeNoLanguage of the alert text and email.en
metricYesWhat to watch: soc (battery %), import_price / export_price (c/kWh, the current Amber interval), temperature (forecast °C).
messageNoThe person's own words, put in front of the alert text; up to 400 characters.
site_idYesSite id from list_sites: vendor:station_id, e.g. sungrow:1445844.
operatorYesFire when the value is above or below the threshold.
thresholdYesThe value to compare with, in the metric's unit (%, c/kWh, °C).
active_endNoHH:MM site local: end of that daily window.00:00
active_startNoHH:MM site local: start of the daily window in which the alert may fire. Same as active_end = all day.00:00
cooldown_minutesNoQuiet time after a firing, in minutes: 15 to 10080.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv0.11.5
    • addedInput schema / properties / active_end / description
      Added value: +"HH:MM site local: end of that daily window."
    • addedInput schema / properties / active_start / description
      Added value: +"HH:MM site local: start of the daily window in which the alert may fire. Same as active_end = all day."
    • addedInput schema / properties / cooldown_minutes / description
      Added value: +"Quiet time after a firing, in minutes: 15 to 10080."
    • addedInput schema / properties / email / description
      Added value: +"Also mail the account's verified address on each firing."
    • addedInput schema / properties / locale / description
      Added value: +"Language of the alert text and email."
    • addedInput schema / properties / locale / enum
      Added value: +[
      +  "en",
      +  "ja",
      +  "th",
      +  "zh-Hans",
      +  "zh-Hant"
      +]
    • addedInput schema / properties / message / description
      Added value: +"The person's own words, put in front of the alert text; up to 400 characters."
    • addedInput schema / properties / metric / description
      Added value: +"What to watch: soc (battery %), import_price / export_price (c/kWh, the current Amber interval), temperature (forecast °C)."
    • addedInput schema / properties / metric / enum
      Added value: +[
      +  "soc",
      +  "import_price",
      +  "export_price",
      +  "temperature"
      +]
    • addedInput schema / properties / name / description
      Added value: +"Title shown on the alert, up to 100 characters. An empty string = one is made from the rule (\"SOC below 20%\")."
    • addedInput schema / properties / operator / description
      Added value: +"Fire when the value is above or below the threshold."
    • addedInput schema / properties / operator / enum
      Added value: +[
      +  "above",
      +  "below"
      +]
    • addedInput schema / properties / site_id / description
      Added value: +"Site id from list_sites: vendor:station_id, e.g. sungrow:1445844."
    • addedInput schema / properties / threshold / description
      Added value: +"The value to compare with, in the metric's unit (%, c/kWh, °C)."
  2. Changed4 schema fields changedv0.11.4
    • addedOutput schema / additionalProperties
      Added value: +true
    • removedOutput schema / properties
      Removed value: -{
      -  "result": {
      -    "title": "Result",
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "result"
      -]
    • changedOutput schema / title
      Previous value: -"create_alertOutput"New value: +"create_alertDictOutput"
  3. First observedv0.9.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare a non-destructive, non-idempotent write, so the bar is lower; the description still adds delivery channels (inbox, phone, optional email), the email dependency on the account's verified address via list_sites account.email_alerts, and the response shape (`created`). It omits what happens if an identical rule already exists, which matters given idempotentHint=false.

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 purpose and firing rule, then delivery behavior, then safety caveat and return value; every sentence carries information. The final sentence about the returned `created` key is somewhat redundant given an output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter write tool with full schema and output schema, this covers the lifecycle (creation, delivery, response) plus the key reassurance that no battery action occurs. Only duplicate-creation behavior and failure modes are left unaddressed.

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 coverage is 100%, so all 11 parameters are already documented, and the description mostly restates the threshold concept rather than adding per-parameter meaning. The one genuinely new semantic is that email=True depends on the account's verified address, which the schema does not convey.

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?

Opens with a specific verb+resource and the firing condition: 'Set up a threshold alert on a site: it fires when the watched metric crosses the threshold.' That immediately separates it from list_alerts and delete_alert, which operate on existing rules.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a real precondition ('Confirm the rule with the user before creating it') and names an alternative path ('let them add it from the list_alerts card'). It also fences scope by stating an alert never changes battery behavior, though it does not say when an agent should skip creating an alert entirely.

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