Skip to main content
Glama

Add or remove device tag

tag_device
DestructiveIdempotent

Add or remove a tag on a GenieACS CPE device to control preset matching and enable tag-based device searches.

Instructions

Add a tag to a CPE device or remove one. Tags group devices: presets match on them (precondition {"tags":"office"}) and search_devices finds by them. Adding or removing a tag can therefore make a preset apply to the device, or stop applying, at its next inform. Tags are case-sensitive. Use letters, digits, "-" and "": GenieACS rejects a tag with other characters (a "." for example) with a 404. Fails with ACS error 404 when the device id does not exist. Example: tag_device(device_id="202BC1-BM632w-000001", tag="office", action="add").

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": {
      "device_id": "<device_id>",
      "tag": "<tag>",
      "action": "<action>"
    },
    "name": "tag_device"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagYesThe tag, e.g. "office", "floor-2", "firmware_pending".
actionYes"add" tags the device, "remove" untags it.
device_idYesThe GenieACS device id (the _id field), exactly as GenieACS stores it, usually OUI-ProductClass-SerialNumber, e.g. "202BC1-BM632w-000001". GenieACS escapes characters other than letters and digits inside the product class and serial as %XX (a "-" there becomes "%2D"), so copy ids from genieacs://devices/list or search_devices rather than typing them.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.4.1
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / action / description
      Previous value: -"The operation to perform: \"add\" to tag the device, \"remove\" to untag it."New value: +"\"add\" tags the device, \"remove\" untags it."
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "add",
      +  "remove"
      +]
    • changedInput schema / properties / device_id / description
      Previous value: -"The exact GenieACS device identifier (_id field). Typically in the format OUI-ProductClass-SerialNumber (e.g. \"00236A-SmartRG585-SMRT00236a42\"). Obtain valid IDs from the genieacs://devices/list resource."New value: +"The GenieACS device id (the _id field), exactly as GenieACS stores it, usually OUI-ProductClass-SerialNumber, e.g. \"202BC1-BM632w-000001\". GenieACS escapes characters other than letters and digits inside the product class and serial as %XX (a \"-\" there becomes \"%2D\"), so copy ids from genieacs://devices/list or search_devices rather than typing them."
    • addedInput schema / properties / device_id / minLength
      Added value: +1
    • changedInput schema / properties / tag / description
      Previous value: -"The tag string to add or remove (e.g. \"office\", \"floor-2\", \"firmware-pending\")."New value: +"The tag, e.g. \"office\", \"floor-2\", \"firmware_pending\"."
    • addedInput schema / properties / tag / minLength
      Added value: +1
    • addedInput schema / properties / tag / pattern
      Added value: +"^[A-Za-z0-9_-]+$"
  2. Addedv0.3.3

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses that tag effects are deferred to the next inform, that tags are case-sensitive, that GenieACS rejects illegal characters with a 404 (a misleading status for an input-validation failure), and that a 404 also means the device id is unknown. This is exactly the side-effect and error-surface information the annotation hints do not carry, and nothing contradicts destructiveHint/idempotentHint.

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 action, then the semantic consequence, then constraints, then an example – a sensible ordering. It is dense and slightly over-packed into few sentences, but nearly every clause carries operational information an agent needs.

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?

With no output schema, the description covers side effects, idempotency implications, and the two failure modes, which is close to complete for a small mutation tool. It does not say what the call returns on success (or whether removing a non-present tag errors), leaving a minor gap.

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 description coverage is 100%, with per-parameter descriptions and an enum for action, so the baseline is 3. The description adds the 404 consequence for invalid tag characters and a worked example call, which is helpful but mostly restates constraints already encoded in the pattern and device_id schema text.

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 ('Add a tag to a CPE device or remove one') and immediately scopes it to GenieACS tags. The add/remove duality is unambiguous and clearly distinct from sibling tools like manage_preset or search_devices that merely consume tags.

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?

Explains the operational consequence of tagging – presets matching on {"_tags":"office"} will start or stop applying at the next inform – which tells the agent when the change matters. It stops short of naming an explicit alternative or a 'do not use this for X' exclusion, so it is clear context rather than full routing guidance.

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