Skip to main content
Glama

wps_word_add_toc

Insert an automatic, updatable table of contents (TOC) with page numbers and hyperlinks into a WPS Word document. Place the TOC after a specified paragraph or at the document start, using heading styles 1–3.

Instructions

插入自动目录(TOC 域,可更新、带页码与超链接)。用于替代手写静态目录:先把正文各级标题设置为"标题 1/2/3"样式,再调用本工具。after_text 指定在哪个段落文本之后插入(常用"目 录"标题段);不给则插到文档开头。目录内容由 TOC 域生成,右键可更新域或执行 UpdateFields。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelsNo目录包含的最高标题级别,默认 3
after_textNo在此段落文本之后插入目录;默认文档开头
upper_levelNo目录包含的最低标题级别,默认 1
Install Server

TDQS

A4.5/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 full burden. It discloses that the TOC is generated by a TOC field, is updateable via right-click or UpdateFields, and includes page numbers and hyperlinks. However, it doesn't state whether this operation is destructive to existing content, whether it requires specific permissions, or what happens if after_text is not found. A 3 is appropriate as it adds meaningful behavior beyond annotations (which are absent) but leaves some gaps.

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 front-loaded with the main action and key features, followed by pre-conditions and parameter explanation. At three sentences, every sentence serves a distinct purpose (what, prerequisites, behavior), with no fluff. It is efficiently structured.

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

Completeness5/5

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

Given the tool's moderate complexity (3 optional params, no output schema, no nested objects, no annotations), the description covers the essential aspects: what the tool does, how to prepare, where the TOC appears, and how to update it. There is no glaring omission for a tool of this type, and it provides complete guidance for an AI agent to use it correctly.

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 100%, so baseline is 3. The description adds value by explaining that 'after_text' should be a paragraph text (often '目录') and that omitting it places the TOC at document start. While levels and upper_level parameters are self-explanatory from schema, the description clarifies the insertion behavior which is not obvious from schema alone. This raises it to 4.

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 clearly states the action (insert auto-generated TOC with specific features: TOC field, updateable, page numbers, hyperlinks). It distinguishes from hand-written static TOCs and provides the exact use case (replacing manual TOCs). This effectively differentiates it from sibling tools like wps_word_read or wps_word_append_paragraph.

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

Usage Guidelines5/5

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

The description gives explicit preconditions (set heading levels to 'Title 1/2/3' styles first), specifies where to insert (after a specific paragraph like '目录' header, or at document start), and implies when to use (for auto-generated TOC vs. manual ones). It provides clear context on when-not-to-use (no need if headings aren't styled).

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

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/Antares422/draftly-wps'

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