Skip to main content
Glama

krusch_apply_diff

Idempotent

Applies a staged task diff to disk only after the invariant gate passes, ensuring file edits are audited and applied atomically.

Instructions

Apply a STAGED task diff to disk after passing the invariant gate.

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": {
      "task_id": "<task_id>"
    },
    "name": "krusch_apply_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
task_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, destructiveHint=false, and the title says 'Atomically', so safety and atomicity are covered structurally. The description's added value is the invariant-gate precondition and the disk-write target, but it says nothing about what happens if the gate fails, whether files are overwritten, or how the write is sequenced.

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?

One sentence, front-loaded with the action and resource, with no filler. The terseness comes at the cost of unexplained jargon ('invariant gate', 'STAGED'), which is a minor structure penalty rather than padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a low-complexity single-parameter mutation tool with rich annotations, most of the safety profile is supplied structurally. The remaining gaps — what task_id must reference and what the caller gets back or should do on gate failure — are exactly the parts no other field covers, and the description leaves them unaddressed.

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

Parameters2/5

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

There is a single required parameter (task_id) with 0% schema description coverage, so the description must carry the meaning of that parameter. The phrase 'task diff' faintly implies task_id identifies the staged diff to apply, but it never states the ID's format, provenance, or whether it must match an existing staged task.

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 ('Apply') and resource ('STAGED task diff') with the destination ('to disk'), which is enough to distinguish it from sibling read/inspect tools like krusch_diff. It does not explicitly name krusch_diff, krusch_reject, or krusch_abort as the non-applying alternatives, so the differentiation is implied rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'after passing the invariant gate' and 'STAGED' imply a prerequisite workflow — a diff must already exist and be verified — which gives partial when-to-use guidance. There is no explicit statement of when to use this instead of krusch_diff (inspect) or krusch_reject (discard), so an agent must infer the routing itself.

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