Skip to main content
Glama

Apply planned file operations

crabrix_apply_operations
DestructiveIdempotent

Applies a batch of planned file operations atomically, guarded by expected revision and plan hash, with an operation ID for safe retries and duplicate prevention.

Instructions

Format 2 rooms only. Apply exactly the operations you planned, with expectedRevision and planHash from crabrix_plan_changes and a new operationId (8–64 letters, digits, - or _) for this change. All operations apply together or none do. If the project changed since the plan, nothing is applied: read and plan again. After OUTCOME_UNKNOWN, retry with the same operationId and operations; an applied change returns alreadyApplied instead of applying twice. Deleted files stay in recovery until purged.

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": {
      "operations": "<operations>",
      "expectedRevision": "<expectedRevision>",
      "planHash": "<planHash>",
      "operationId": "<operationId>"
    },
    "name": "crabrix_apply_operations"
  }
}

Input Schema

NameRequiredDescriptionDefault
planHashYes
operationsYes
operationIdYes
expectedRevisionYes

Output Schema

NameRequiredDescriptionDefault
formatYes
changedYes
revisionYes
alreadyAppliedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructive=true, idempotent=true, readOnly=false, but the description adds genuinely new behavior: all-or-nothing atomicity, optimistic concurrency rejection on revision mismatch, duplicate suppression via operationId returning alreadyApplied, and that deletions remain recoverable until purged. These are the exact traits an agent needs to reason about retries and safety, well beyond the hint flags.

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?

Dense and mostly front-loaded: the precondition, the atomicity guarantee, the conflict path, and the retry path arrive in that order with no filler. The opening 'Format 2 rooms only' is an unexplained fragment that consumes prime position without conveying actionable meaning.

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 destructive, atomic batch-mutation tool with four required params, the description covers concurrency, atomicity, idempotent retry, and recovery semantics, and an output schema exists so return values need not be spelled out. The remaining gap is that the twelve operation kinds are never characterized in prose, leaving the agent to infer the full vocabulary of mutations from the schema alone.

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?

With 0% schema description coverage, the description carries the burden and does so for three of four top-level params: it names the source of expectedRevision and planHash, the character class and length bounds of operationId, and the requirement that it be new for this change. The operations array's element kinds are left entirely to the schema's const discriminators with no prose explanation of what each kind does.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Apply exactly the operations you planned') and ties it to the output of crabrix_plan_changes, so the plan/apply pair is legible. It does not differentiate itself from the sibling crabrix_apply_changes, and the leading 'Format 2 rooms only' is unexplained jargon that an agent cannot act on.

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 concrete usage conditions: supply expectedRevision and planHash from crabrix_plan_changes, mint a new operationId, and if the project changed, re-read and re-plan rather than retrying. The retry rule after OUTCOME_UNKNOWN (same operationId and operations) is explicit. The only missing routing guidance is when to prefer this over crabrix_apply_changes.

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