Skip to main content
Glama

writing_patch

Apply an agent-supplied replacement to one unique anchor while enforcing protected-block and citation gates, ensuring gated, traceable manuscript edits.

Instructions

Apply an agent-supplied replacement for one unique anchor with all protected-block and citation gates enforced.

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": {
      "workspace": "<workspace>",
      "run_id": "<run_id>",
      "target": "<target>",
      "anchor": "<anchor>"
    },
    "name": "writing_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
anchorYes
run_idYes
targetYes
workspaceYes
replacementNo
instructionsNo
source_sha256No
allow_line_rangeNo
replacement_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv4.2.0
    • changedInput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedInput schema / properties
      Added value: +{
      +  "allow_line_range": {
      +    "type": "array"
      +  },
      +  "anchor": {
      +    "type": "string"
      +  },
      +  "instructions": {
      +    "default": "",
      +    "type": "string"
      +  },
      +  "replacement": {
      +    "type": "string"
      +  },
      +  "replacement_path": {
      +    "type": "string"
      +  },
      +  "run_id": {
      +    "type": "string"
      +  },
      +  "source_sha256": {
      +    "type": "string"
      +  },
      +  "target": {
      +    "type": "string"
      +  },
      +  "workspace": {
      +    "type": "string"
      +  }
      +}
    • addedInput schema / required
      Added value: +[
      +  "workspace",
      +  "run_id",
      +  "target",
      +  "anchor"
      +]
  2. First observedv4.0.0

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full behavioral burden. It does disclose something valuable beyond the schema: protected-block and citation gates are enforced, implying the call can be rejected by validation. However, it omits mutability/irreversibility, atomicity on failure, and what happens when the anchor is not unique.

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?

A single front-loaded sentence with no filler, and the core action is placed first. It is efficient, though the density of undefined jargon means brevity comes partly at the cost of comprehension.

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

Completeness2/5

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

A 9-parameter mutation tool with no annotations and no output schema needs considerably more description than one sentence. The agent has no way to know which optional parameters are needed, how conflicts between replacement and replacement_path are resolved, or what a gated rejection looks like.

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?

Schema description coverage is 0% across 9 parameters, so the description must compensate and largely does not. It gestures at 'anchor' and 'replacement' but says nothing about workspace, run_id, target, source_sha256, allow_line_range, replacement_path, or instructions — including the critical distinction between inline replacement and replacement_path.

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?

The description uses a specific verb+resource pair: 'apply an agent-supplied replacement for one unique anchor', which tells an agent this is a targeted single-point text edit rather than a bulk import or pack operation. It does not explicitly contrast itself with writing_import or writing_pack, and relies on jargon ('anchor', 'protected-block') that an agent may not fully resolve.

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

Usage Guidelines2/5

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

There is no statement of when to use this tool versus writing_import, writing_pack, or writing_plan, nor any preconditions beyond the implied 'unique anchor must exist'. The mention of enforced gates hints at failure conditions but is framed as behavior, not as guidance on choosing this tool.

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