Skip to main content
Glama
bagushd1
by bagushd1

add_table_of_contents_docx

Add a table of contents to Word .docx files by auto-detecting headings or using manual entries, with dynamic Word fields, hierarchy indents, custom titles, and page breaks.

Instructions

Menambahkan Daftar Isi (Table of Contents / TOC) pada dokumen .docx. Mendukung TOC dinamis Word (field fldSimple/complex F9), entri manual / terhitung dengan dot leaders (... nomor halaman), auto-deteksi heading dokumen, indentasi hierarki level, kustomisasi judul ('DAFTAR ISI', 'DAFTAR TABEL', 'DAFTAR GAMBAR'), dan page break.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entriesNo
headingNoDAFTAR ISI
toc_typeNoauto
file_pathYes
font_nameNo
max_levelNo
tab_leaderNodots
bold_level_1No
font_size_ptNo
line_spacingNo
insert_beforeNo
space_after_ptNo
level_indent_cmNo
paragraph_indexNo
page_break_afterNo
page_break_beforeNo
heading_font_size_ptNo
update_fields_on_openNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that dynamic TOCs use Word fields and mentions update_fields_on_open behavior implicitly through the option list, and it names what gets inserted (TOC, page breaks, heading). However it doesn't state whether the file is modified in place, whether existing content is shifted, permission needs, or file-overwrite/backup behavior. For a mutating document tool, this is a notable gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It's a single long run-on sentence in Indonesian with a dense feature list. It is reasonably front-loaded with the core action but packs many features into one clause-heavy enumeration, which reduces scannability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is an output schema, so return values need not be explained. But with 18 undocumented parameters, no annotations, and no usage prerequisites, the description is not complete enough for an agent to invoke this correctly without opening the full schema. It should at minimum clarify the key modes (toc_type values, entries vs auto detection, insertion position).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and there are 18 parameters, yet the description only loosely maps a handful (heading title examples, dot leaders, auto-detect headings, level indentation). Most parameters (insert_before, paragraph_index, font_size_pt, line_spacing, space_after_pt, bold_level_1, update_fields_on_open) are never explained. The description does not compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb+resource: adding a Table of Contents to a .docx document. It's specific about TOC types (dynamic Word field vs. manual entries) and options. It doesn't explicitly differentiate from siblings, but siblings are almost all table or text-formatting tools, so the TOC-specific purpose is clear without naming an alternative.

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?

The description implies usage context (you want a TOC in a docx) and lists supported features, but it never says when to choose this over alternatives like building a TOC manually with add_styled_paragraph, nor does it state prerequisites such as needing existing headings. Usage is implied rather than guided.

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