Skip to main content
Glama

Rename a block id

geml_rename
Idempotent

Rename a block id and every reference to it in one document with id-boundary-safe writes, instead of a search-and-replace that also hits shared prefixes.

Instructions

Rename a block id AND every reference to it in the same document, in one id-boundary-safe write. Use this rather than geml_set or a text search-and-replace, which would also hit ids that merely share a prefix. A Markdown heading's anchor is its text, so it is renamed by changing the heading with geml_set (part: head), not here. An old id that does not exist, or a new one already taken, is refused. Returns {ok, file, diagnostics, revision}, with notes when the write did something to say out loud (a block it dropped, an address it changed); a refusal is ok: false with a hint, and the file is unchanged.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newYesNew id
oldYesCurrent id
fileYesDocument path relative to the server's --root directory, e.g. notes/spec.geml

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare the safety trio; the description adds refusal semantics (nonexistent `old`, taken `new`), the exact return shape including `notes` and `hint`, and the guarantee that a refused call leaves the file unchanged. Minor tension: `notes` mentions 'a block it dropped' while destructiveHint=false, which is worth noting but is a stated, surfaced side effect rather than a hidden one.

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?

Front-loaded with the operation and the differentiator, then routing exclusions, then the return/error contract. Dense but every sentence carries routing or behavioral information.

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

Completeness5/5

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

With no output schema, the description supplies the return contract, the error contract, and the no-side-effect-on-refusal guarantee, which is everything needed to call and interpret this mutation tool.

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?

Schema coverage is 100%, so baseline is 3, but the description genuinely adds semantics for `old`/`new`: `old` must exist and `new` must be free, and the schema's terse descriptions ('Current id', 'New id') gain real constraints.

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 precise verb+resource (rename a block id) and its scope (every reference in the same document), and explicitly names the siblings it must not be confused with (geml_set, text search-and-replace). An agent can route to this tool without opening any schema.

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

Usage Guidelines5/5

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

Explicit when-to-use with named alternatives and the reason they are wrong ('would also hit ids that merely share a prefix'), plus an explicit when-NOT-to-use case (Markdown heading anchors go through geml_set with `part: head`). Conditions for refusal are also given.

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