Skip to main content
Glama

xref_add

Insert a tracked cross-reference field in a Word document, pointing to a caption or paragraph, with options for number, text, or page. Adds a bookmark if needed; fields.update resolves it.

Instructions

Insert a cross-reference field (REF, or PAGEREF for the page) at an insertion point, as a tracked insertion, pointing at a caption or another body paragraph. The target gets a hidden bookmark when it has none that fits. fields.update fills in the shown number, text or page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
atYesInsertion point: p<n>#<fp>:<k>-<k>, or a paragraph address for its end.
toYesAddress of the caption or heading it points at.
docYesPath to the .docx.
tagNoAppended to the author.
showNonumber (default): a caption's label and number, or a paragraph's number; page: the page it is on; text: the caption or paragraph text.
authorNoRevision author.
expectNo
dry_runNoPreview only; write nothing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false, so the description carries most of the behavioral burden. It discloses that the operation is a tracked insertion, that the target gets a hidden bookmark when none fits, and that fields.update is needed to show values. Good transparency for a mutation tool, though it doesn't mention authorization or side effects on existing bookmarks.

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?

Two sentences that are front-loaded with the core action and follow with necessary behavioral details. No wasted words; efficient for the complexity.

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?

The description covers the essential behavior, side effects (bookmark creation), and the follow-up step (fields.update). It omits some edge cases like behavior when the target already has a fitting bookmark or error conditions, but is largely complete for an 8-parameter mutation tool with no output schema.

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 coverage is 88%, so the schema already documents parameters like at, to, show, author, dry_run. The description adds meaning for how the field points at targets and the role of show values, but doesn't add syntax or format details beyond the schema's own descriptions.

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+resource ('Insert a cross-reference field') and details the variants (REF, PAGEREF), the target types (caption or body paragraph), and the adjacent tool (fields.update fills in the number). Clearly distinguishable from siblings like caption_add or fields_update.

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?

Explains what happens and points to fields_update for filling in values, giving implicit context for when to use this versus fields_update. Does not explicitly state when to use this over other insert tools like index_insert or toc_insert, but the cross-reference purpose is clear.

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