Skip to main content
Glama

merge_rewrite

Merge an approved rewrite artifact into the canonical document: snapshots the previous version, writes the new one with provenance, and transitions the rewrite to merged.

Instructions

Merge an approved rewrite artifact into the canonical project document. Snapshots previous canonical, writes new with provenance, transitions rewrite to merged. Requires rewrite to be in approved state and approver to meet minimum tier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoSkip supersedes check when overwriting an existing canonical (default false)
approverYesIdentity of the approver (agent_id or human name); must meet min tier
supersedesNoPath being superseded — required if canonical already exists
rewrite_pathYesRelative path to the rewrite artifact (must have status: approved)
canonical_pathYesRelative path to the target canonical document
source_task_idNoTask that produced this rewrite (optional)
promotion_reasonNoWhy this rewrite is being merged (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that the previous canonical is snapshotted, that the new document is written with provenance, and that the rewrite state transitions to merged. It still omits failure behavior on tier/approved checks and whether the merge is reversible beyond the snapshot.

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?

Three short sentences, front-loaded with the action, then side effects, then preconditions. Every clause earns its place with no repetition of schema text.

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 mutation tool with no annotations and no output schema, the description covers the action, side effects, state transition, and preconditions adequately. It stops short of explaining supersedes/force interaction or the result of a failed merge, which are the remaining gaps.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters (including force and supersedes) are already documented in structured form. The description adds only the approved-state and approver-tier constraints, which map to rewrite_path and approver, so the baseline of 3 applies.

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: 'Merge an approved rewrite artifact into the canonical project document.' This clearly separates it from write_rewrite_artifact (which creates the artifact) and from the read/search siblings, so an agent can pick it without opening the schema.

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?

It gives two hard preconditions for use ('rewrite must be in approved state' and 'approver must meet minimum tier'), which implies the context in which the tool is callable. However, it never names an alternative (e.g. write_rewrite_artifact) or states when not to merge, so the when/when-not routing is left to inference.

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