Skip to main content
Glama

insert_toc

Insert a Table of Contents into a Word document with configurable heading depth and automatic page number updates on open or field refresh.

Instructions

Insert a Table of Contents (SDT-wrapped TOC field); levels like '1-3' picks heading depth. Page numbers appear after Word updates fields: automatically on next open (update_on_open) or immediately via com_refresh_fields. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoTable of Contents
backupNo
levelsNo1-3
at_startNo
file_pathYes
after_indexNo
update_on_openNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well. It discloses the SDT-wrapped field structure, page-number update timing, auto-backup slot behavior, backup=False nuance, atomic validated save, and refusal of documents open in Word.

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?

The description is compact and front-loaded with the core purpose, then packs essential operational details into a few dense sentences. No redundant phrases; every clause contributes behavior or parameter context.

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 7-parameter mutation tool with no annotations, the description covers safety (atomic save, backup, open-document refusal), refresh behavior, and the key levels parameter. Placement semantics (at_start, after_index) are only implied, and existing-TOC behavior is not addressed, but an output schema exists and most critical context is present.

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 description coverage is 0%, and the description compensates for the most important parameters: levels ('1-3' picks heading depth), update_on_open (automatic on next open), and backup (backup=False skips rotation only). It does not explain title, at_start, or after_index, but their names and schema defaults make them reasonably inferable.

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 description opens with 'Insert a Table of Contents' — a specific verb and resource — and adds 'SDT-wrapped TOC field' for technical precision. This clearly differentiates it from siblings like read_toc, delete_toc, and insert_caption_list.

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?

It gives actionable context: page numbers require a field update, either via update_on_open or 'immediately via com_refresh_fields', and it warns that the tool 'refuses documents open in Word', an important exclusion. It does not explicitly contrast with read_toc/delete_toc, but the main usage conditions are clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nometalalchemist/KitchenSink4Word'

If you have feedback or need assistance with the MCP directory API, please join our Discord server