Skip to main content
Glama

fields_update

Recompute TOC, page, page-count, sequence and reference fields in .docx via LibreOffice and write results as tracked changes; or flag Word to update fields on open.

Instructions

Recompute the results of the body's TOC, page, page-count, sequence and reference fields through headless LibreOffice and write only those result runs, as tracked changes (the old result is struck, the new one inserted). Without LibreOffice it refuses with ENGINE_UNAVAILABLE naming the stale fields; set_update_on_open sets w:updateFields instead, so Word updates the fields when it opens the file. Citation fields are never changed. SECTIONPAGES, SECTION and NOTEREF are not recomputed (LibreOffice keeps their cached results) and are listed under skipped. INDEX is never recomputed (LibreOffice ignores its switches and flattens sub-entries): every index is left as it is and listed under skipped; rebuild it in Word (F9). A REF that LibreOffice resolves to an error (a missing bookmark) or to nothing (a number of an unnumbered paragraph) keeps its result and is listed under skipped. Fields it could not pair with LibreOffice's are listed under skipped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docYesPath to the .docx.
tagNoAppended to the author.
authorNoRevision author.
expectNo
dry_runNoPreview only; write nothing.
set_update_on_openNoOnly set w:updateFields in settings.xml (no LibreOffice).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the lone readOnlyHint=false annotation, it discloses the write mechanism (old result struck, new inserted as tracked changes), the failure mode and error code (ENGINE_UNAVAILABLE naming stale fields), the skip semantics for SECTIONPAGES/SECTION/NOTEREF/INDEX/error REFs, and that citation fields are never touched. This is rich behavior that no structured field conveys.

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?

The purpose is front-loaded and every sentence carries distinct behavioral content with no repetition. It is dense, however, with long semicolon-and-parenthesis chains (especially the INDEX and REF explanations) that make it harder to scan than necessary.

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 output schema and no annotations beyond readOnlyHint=false, this covers the essentials: preconditions, fallback, side effects, and which results are omitted. What is returned is only hinted at via 'listed under skipped' rather than described, leaving a small gap.

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 high at 83%, so the baseline is 3, but the description meaningfully augments set_update_on_open by explaining the w:updateFields effect and that no LibreOffice run occurs. tag, author, expect, and dry_run receive no added meaning beyond their schema 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?

The opening states a precise verb and resource: recompute the body's TOC, page, page-count, sequence and reference field results and write only those result runs as tracked changes. It is immediately distinguishable from siblings like fields_list, index_mark, or toc_insert.

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?

Explicit conditions are given: it refuses with ENGINE_UNAVAILABLE without LibreOffice, and set_update_on_open is offered as the alternative that defers updating to Word. It also enumerates exactly which field types are not recomputed. It does not, however, route to any sibling tool (e.g. fields_list, index_insert) for related workflows.

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