Skip to main content
Glama

toc_insert

Insert a tracked table of contents after a chosen body paragraph in a .docx, with optional title and heading levels; the field remains stale until fields.update fills it.

Instructions

Insert a table of contents (a TOC field) after a body paragraph, as tracked insertions: an optional title, the field with a placeholder result and the paragraph that closes it. The result text is filled by fields.update; until then fields.list shows the field as stale. Returns the address of the field's paragraph.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docYesPath to the .docx.
tagNoAppended to the author.
afterYesAddress of the body paragraph it goes after.
titleNoTitle paragraph above it (default "Contents"); "" for none.
authorNoRevision author.
expectNo
levelsNoHeading levels it lists, e.g. "1-3" (default) or "2".
dry_runNoPreview only; write nothing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With only readOnlyHint=false in annotations, the description carries real weight: it discloses that the operation writes tracked insertions, inserts a placeholder result that is stale until fields.update runs, and returns the field paragraph address. It still omits auth/expectation requirements and reversibility.

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?

Three front-loaded sentences with no waste: the action, the follow-up dependency, and the return value. Every clause earns its place.

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 write tool with 8 params, minimal annotations, and no output schema, the description covers behavior, follow-up workflow, and return value. The expect/sha256 concurrency guard and permission requirements are left undocumented, a minor gap given the rich 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 description coverage is 88%, so the schema already documents nearly all parameters. The description only adds that the title is 'optional', which is marginal over what the schema provides; the baseline 3 is appropriate.

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 ('Insert a table of contents (a TOC field) after a body paragraph') plus the mechanism ('as tracked insertions'). It is immediately distinguishable from unrelated siblings like index_insert or caption_add by its named resource.

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

Usage Guidelines3/5

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

It explains the workflow dependency (result filled by fields.update, stale in fields.list until then), which implies the follow-up step, but gives no explicit when-to-use-vs-alternatives guidance or prerequisites such as the expect/sha256 guard. Usage is implied rather than directed.

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