Skip to main content
Glama

Create / change / delete Flow rules

myio_flow_save
DestructiveIdempotent

Saves or updates myIO flow rules, variables, hooks, or the full flows.jsn file, validates changes first, and reloads the engine without restarting.

Instructions

Edit flows.jsn and reload the engine (no restart). Give ONE of: flow (a whole rule object; replaces the rule with the same id or adds it), delete (flow id), variable {id,name,init} / delete_variable, hook {id,name,met,url,body,err,gap} / delete_hook, or file (the complete flows.jsn). The rule is validated against the controller's card rules first; nothing is written on error. dry_run=true only validates. Card format (keys are short): WHEN t=sens{src:thermo|hum|usens, ch|id, op:gt|lt, val x10, hyst x10} | scmp | out{id, dir 0 off/1 on/2 any} | time{min, days} | sun{ev:rise|set, off} | var{id, op, val} | boot; AND t=sens | scmp | out{id, on 0|1} | twin{from, to, days} | var; THEN t=rel|grp{id, act 0 off/1 on/2 toggle} | pca|fet{id, val 0..255} | delay{s|m} | var{id, op:set|inc|dec, val} | log{val} | msg | http{id: webhook slot, val}. days = bitmask bit0=Mon..bit6=Sun (127 = every day); minutes of day for time/twin; temperatures x10 (21.5 °C = 215). Full reference: myio_reference topic=flow. Editor/admin level.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "myio_flow_save"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNothe complete flows.jsn (replaces everything)
flowNo{"id":1,"name":"...","en":1,"when":{...},"and":[...],"then":[...]}
hookNo
deleteNoflow id to delete
serverNocontroller name (default Ground floor)
dry_runNo
variableNo
delete_hookNo
delete_variableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.2

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description adds real context on top: rules are validated against controller card rules first, nothing is written on error, dry_run only validates, the engine is reloaded without a restart, and 'Editor/admin level' discloses the authorization requirement. It also clarifies the replace-vs-add semantics of the flow mode and that file 'replaces everything'.

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 operation list before any grammar detail, so the decision-relevant content comes first. The dense single-paragraph card-format block is long and hard to scan, and it partially duplicates the reference the description itself points to (myio_reference topic=flow).

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 a 9-parameter destructive mutation tool with nested objects and no output schema, the description covers validation, error behavior, auth level, dry-run, and encoding conventions. The remaining gap is success behavior: it never says what a successful call returns or confirms (new rule id, reload status), which matters because no output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 44% schema coverage across 9 parameters, the description carries the burden and does: it defines each selector (flow, delete, variable/delete_variable, hook/delete_hook, file) and the semantics of dry_run. It goes further with the WHEN/AND/THEN card grammar, the days bitmask (bit0=Mon..bit6=Sun, 127=every day), and the x10 temperature scaling (21.5 °C = 215), none of which appear in the schema. Only the 'server' parameter is left to 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?

Opens with a specific verb+resource pair: 'Edit flows.jsn and reload the engine (no restart)'. The subsequent enumeration of mutually exclusive modes (flow, delete, variable, hook, file, dry_run) makes it unmistakable that this is the single write path for Flow rules, as distinct from the read-oriented myio_flows / myio_flow siblings.

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?

Explicitly instructs 'Give ONE of: ...', which prevents an agent from combining flow and file in one call, and states that validation precedes any write so errors are safe to retry. It also routes to myio_reference topic=flow for the full grammar. What is missing is when NOT to use this tool (e.g., point to myio_flows to inspect existing rules before editing).

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