Skip to main content
Glama

Read a .docx

docx_read
Read-only

Read Microsoft Word .docx paragraphs with 1-based indices before editing. Choose text, outline, or tables mode, page large documents with from/to, and get each paragraph's style.

Instructions

Read a Microsoft Word .docx document and return its paragraphs with 1-based indices.

Use this before docx_edit: the returned paragraph index is the address every edit operation uses. Each paragraph reports its text, its style id (e.g. Heading1), and whether it sits inside a table. Runs are merged, so text that Word split across formatting runs still reads as one continuous string.

Modes:

  • text (default): every paragraph in document order.

  • outline: only styled paragraphs (headings, titles) — use it for a quick structural overview.

  • tables: only paragraphs inside table cells.

Large documents are paged: pass from/to to move through them, and check truncated in the result. This tool only reads. To change the document, follow up with docx_edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoLast paragraph index to return, inclusive (default: from + number of paragraphs that fit).
fromNoFirst paragraph index to return, 1-based (default 1).
modeNotext (default) = all paragraphs; outline = styled paragraphs only; tables = paragraphs inside tables.
pathYesPath to the .docx file (absolute, or relative to the server root).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover read-only safety, and the description adds substantive behavior beyond them: runs are merged across formatting splits, results are paged with a `truncated` flag, and each paragraph reports style id and table membership. It also reinforces that the tool cannot mutate anything.

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?

Front-loaded with purpose and the critical edit-ordering constraint, then modes, then paging. Efficient overall, though the Modes block partly restates the enum descriptions already present in the schema.

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?

With no output schema, the description carries the burden of describing return values and does so fully — paragraph text, style id, table flag, indices, and truncation state — leaving nothing essential unspecified for a read call.

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 goes further by explaining that `from`/`to` are the paging mechanism and framing `outline`/`tables` by intent rather than just restating the enum. It does not, however, add syntax or edge-case detail beyond the schema.

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 ('Read a Microsoft Word .docx document') plus what it returns ('paragraphs with 1-based indices'), which cleanly separates it from docx_edit and docx_create.

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?

Explicitly routes the agent: 'Use this before docx_edit' because the returned index is the edit address, and names the follow-up tool for mutations. It also gives concrete when-to-use guidance for each mode ('use it for a quick structural overview').

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