Skip to main content
Glama

Rename a tag

rename_tag
Destructive

Renames a tag across a wiki space, updating page bodies, front matter, and structured content while preserving unrelated content; merges with an existing target and skips pages the caller cannot edit.

Instructions

Renames a tag across one space, like the tag rename in the web app: #from in page bodies (never in code, links or HTML), from in tags:/labels: front matter (each entry edited in place, in its own style; labels: stays labels:), and the tags of tables, forms, boards, PDFs and Office files; a child tag from/x becomes to/x. Everything else in a page stays byte for byte. One Git commit authored by the connected user. Only pages the caller can edit are changed; pages the caller can open but not edit are counted in pagesSkipped and keep the old tag (pages the caller cannot open are never changed or counted). If to already exists the tags merge. Names are normalized (lowercase, no #). Requires an editor role in the space and a write-scoped token.

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": {
      "space": "<space>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "rename_tag"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesNew name, e.g. "project/beta"; must contain a letter and must not look like a colour (#fff)
fromYesTag to rename, e.g. "project/alpha" (a leading # is ignored); its children are renamed too
spaceYesSpace slug

Output Schema

NameRequiredDescriptionDefault
toYesIts new name, normalized
fromYesThe tag that was renamed, normalized
pagesChangedYesPages whose tags were rewritten (body #tags, tags:/labels: front matter, sidecars)
pagesSkippedYesPages that carry the tag, that the caller can open but not edit (or that could not be written); they keep the old tag. Pages the caller cannot open are not counted

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, and the description goes well beyond them: byte-for-byte preservation of the rest of the page, exactly one Git commit authored by the connected user, child tags renamed recursively, merge behavior when `to` already exists, name normalization, and permission-scoped effects on uneditable pages. That is unusually rich disclosure for a mutation tool.

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?

Purpose and scope are front-loaded before the edge cases, and there is essentially no filler. The single dense paragraph with semicolon chaining makes the skip/merge/permission rules harder to scan than a short bulleted structure would, which costs a point.

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?

An output schema exists, so return values need not be described, yet the description still explains the `pagesSkipped` counter and the permission cases behind it. Combined with auth requirements, merge semantics and the exact mutation surface, an agent has everything needed to call this safely.

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% and the schema already explains examples and validation for all three parameters, so the baseline is 3. The description still adds meaning: names are normalized to lowercase with no leading `#`, and supplying an existing `to` triggers a merge rather than an error — both of which change how an agent should choose values.

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 ("Renames a tag across one space") and immediately enumerates the exact surfaces affected: `#from` in page bodies, `from` in tags:/labels: front matter, and tags on tables, forms, boards, PDFs and Office files. It also pins the scope to one space and to pages the caller can edit, which no sibling tool covers.

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?

Gives clear operating context and hard prerequisites: an editor role in the space and a write-scoped token, plus explicit exclusions (never inside code, links or HTML). It does not name a when-to-use alternative or a when-not-to-use case, but the sibling list contains no plausible rename substitute, so the practical guidance is adequate.

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