Skip to main content
Glama

replace_relation

Destructive

Replace an exact relation by changing its target and/or type in one atomic write, preserving or replacing its rationale. Dry-run by default; confirm:true applies the change.

Instructions

Atomically replace one exact relation with a new target and/or type, moving or replacing its rationale in the same frontmatter write. Defaults to dry-run; pass confirm:true to write. Supports expected_mtime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whyNo
fromYesSource slug.
newToYesReplacement target slug.
oldToYesCurrent target slug.
confirmNo
newTypeYes
oldTypeYes
expected_mtimeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
fromYes
dryRunYes
changedYes
canConfirmYesTrue only when repeating the call with confirm:true can perform the previewed change without another explicit safety opt-in.
newRelationYes
oldRelationYes
wouldChangeYesTrue only when the dry-run predicts a disk or Git change.
previewReadyYesTrue only when this response is a complete dry-run preview that an agent can review.
blockedReasonsYesMachine-readable human explanations for every condition currently blocking confirmation.
postWriteMaintenanceNoCompact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, the description reveals important behaviors: atomic replacement, same-write rationale handling, dry-run default, the need for confirm:true to persist, and support for expected_mtime. This materially helps an agent understand side effects and invocation safety, especially given destructiveHint is true.

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?

Two tightly packed sentences lead with the core operation, then state safety, confirmation, and concurrency control. There is no redundancy, and every clause adds operational value.

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 mutation tool with 8 parameters and low schema coverage, the description covers the essential behavioral context: atomic replacement, dry-run default, confirm flag, and expected_mtime. It does not explicitly state failure behavior when the exact relation is absent or whether existing relations are preserved, but the output schema and exact-match wording reduce ambiguity enough for an agent to proceed.

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 only 38%, so the description must compensate. It alludes to oldTo/oldType/newTo/newType ('target and/or type'), confirm, expected_mtime, and why ('rationale'), but it does not clearly define the relationship between all required parameters, especially from, or explain the semantics of why versus the other fields. The description helps but leaves room for parameter misuse.

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?

The description states a specific action ('Atomically replace'), a precise resource ('one exact relation'), and the fields changed ('new target and/or type'), which clearly distinguishes it from add_relation and remove_relation. It also conveys the operation's scope as a single frontmatter write, leaving no ambiguity about what the tool does.

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?

The description gives a clear context for use: replace an exact existing relation with a new target/type atomically, and it explains the safe default dry-run plus the confirm write flag. It does not explicitly name sibling alternatives or state when not to use it, but the operation semantics are specific enough to route an agent correctly.

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