Skip to main content
Glama

Apply Plan

apply_plan
Destructive

Execute ordered write operations with per-step snapshots and journals, stopping on first failure and refusing stale plans via planFingerprint so validated changes apply safely.

Instructions

Execute write operations in order, stopping on first failure. Each step is snapshotted and journaled individually. Pass the planFingerprint from plan_changes so the plan is refused (PLAN_STATE_CHANGED) when the configuration it touches changed after the preview — this check applies to every role. Non-admin identities also need a confirmationToken (same two-step flow as other destructive tools), itself bound to the state when issued. Undo individual steps via rollback_change with the returned journal IDs.

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": {
      "steps": "<steps>"
    },
    "name": "apply_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYesOrdered list of write operations to apply in sequence
routerIdNoRouter ID; omit to use the default router.
planFingerprintNoThe planFingerprint from plan_changes. When given, apply_plan first checks that the steps are the planned ones and that the configuration each step touches is still what plan_changes saw, and refuses with PLAN_STATE_CHANGED if not. Recommended: without it, the plan runs against whatever the state is now.
confirmationTokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.17.0
    • addedInput schema / properties / planFingerprint
      Added value: +{
      +  "description": "The planFingerprint from plan_changes. When given, apply_plan first checks that the steps are the planned ones and that the configuration each step touches is still what plan_changes saw, and refuses with PLAN_STATE_CHANGED if not. Recommended: without it, the plan runs against whatever the state is now.",
      +  "pattern": "^[0-9a-f]{64}\\.[0-9a-f]{64}$",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv1.14.1
    • removedInput schema / properties / confirmationToken / description
      Removed value: -"Token from a prior APPROVAL_REQUIRED response. Re-submit the identical call with this token to confirm the destructive action."
  3. Changed2 schema fields changedv1.6.0
    • changedInput schema / properties / routerId / description
      Previous value: -"Target router identifier"New value: +"Router ID; omit to use the default router."
    • changedInput schema / required
      Previous value: -[
      -  "routerId",
      -  "steps"
      -]New value: +[
      +  "steps"
      +]
  4. Addedv1.5.0
  5. Removedv1.1.0
  6. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructive=true and idempotent=false, but the description adds substantial behavior beyond them: sequential fail-fast execution, per-step snapshot and journaling, the PLAN_STATE_CHANGED refusal condition applying to every role, and the two-step confirmation flow bound to issuance-time state. These are exactly the details an agent needs before firing a destructive batch.

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 core execution behavior, then prerequisites, then the undo path — a sensible order with no filler sentences. It is dense and stacks several parenthetical qualifications, which slightly hurts scannability but every sentence carries 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, 4-parameter batch executor with no output schema, the description covers failure semantics, state-validation, auth requirements, and the recovery path via returned journal IDs. Nothing an agent needs to call it safely 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 75%, and the description closes the main gap by explaining confirmationToken's role and state binding, which the schema leaves undocumented. It also reinforces planFingerprint's refusal semantics with cross-role applicability. The steps/tool/params semantics are already fully specified in the schema, so it adds meaning without duplicating everything.

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?

States a specific verb and resource plus execution semantics: 'Execute write operations in order, stopping on first failure.' It also implicitly contrasts with plan_changes (preview/planFingerprint source) and rollback_change (undo path), so an agent can distinguish it from siblings without opening a schema.

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 clear conditions: pass planFingerprint from plan_changes so a stale plan is refused, and non-admin identities additionally need a confirmationToken. It also points to rollback_change for undoing specific steps. It does not state exclusions or when to avoid batching versus other write paths, so 4 rather than 5.

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