Skip to main content
Glama

Apply Approved UniFi Change

unifi_apply_change
Destructive

Applies a previewed UniFi change or batch with the owner's one-time approval code, verifies each target, reports what changed, and returns rollback data.

Instructions

Applies the previewed change or batch with the owner's one-time approval code, then reads each target back and reports what changed. A batch applies in order and stops at the first change that does not apply; status partial lists results and what was not attempted. Refuses unapproved, mismatched, expired, reused, and stale approvals. Use the returned rollback to undo.

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": {
      "changeId": "<changeId>",
      "approvalCode": "<approvalCode>"
    },
    "name": "unifi_apply_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
changeIdYes
approvalCodeYes

Output Schema

NameRequiredDescriptionDefault
kindYes
statusYes
targetYes
verifiedYes
operationIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructive=true and readOnly=false, but the description goes well beyond them: batch changes apply in order and halt at the first failure, a 'partial' status enumerates what was and wasn't attempted, every target is read back post-change, and approvals are single-use and rejectable on five distinct grounds. This is exactly the operational context an agent cannot get from the 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five short sentences, front-loaded with the action, followed by failure semantics, refusal conditions, and recovery. No redundant restatement of the schema or annotations; every clause carries operational information.

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 two-parameter mutation with an output schema, the definition covers prerequisites, ordering, partial-failure semantics, refusal modes, and the rollback path. Return values are covered by the output schema, so nothing critical 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 0%, so the description must carry the load. It adds real meaning: changeId refers to a previously previewed change or batch, and approvalCode is the owner's one-time credential that can be expired or reused and will be refused. It doesn't restate the regex formats, but the semantic intent of both parameters is clear.

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?

Names a specific verb and resource ('Applies the previewed change or batch') plus the follow-up behavior (reads each target back and reports what changed). The word 'previewed' implicitly separates it from unifi_preview_change and unifi_preview_batch without needing their schemas.

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?

Establishes the precondition clearly (a previewed change plus the owner's one-time approval code) and explicitly enumerates the states it refuses: unapproved, mismatched, expired, reused, stale. It also closes the loop with 'Use the returned rollback to undo'. No sibling alternative is named outright, so it stops short of a full when/when-not map.

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