Skip to main content
Glama

get_document_outline

Read-only

Extract a compact structural outline of DOCX headings as JSON or Markdown, including numbered labels and optional heuristic headings, to quickly understand document structure.

Instructions

Get a compact structural map of a document's headings (DOCX only). Each entry is {paragraph_id, text, level, source}, plus list_label (e.g. "Section 1.01") when the heading is numbered; Markdown puts the label before the text. Deterministic sources are word_style, list_metadata, and outline_level, selected in that precedence order and included by default. Heuristic sources are run_in_header, title_with_period, title_with_colon, title_caps_centered, and title_bare; set include_heuristic_headings=true to include them. JSON preserves levels 1-9; Markdown clamps visual ATX depth to 6. Read-only.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_document_outline"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoOutput format: 'json' (default, structured outline array) or 'markdown' (indented ATX outline under `content`).
file_pathNoPath to the DOCX file.
include_heuristic_headingsNoWhen true, also include heuristic title/run-in/centered-caps headings alongside deterministic word_style, list_metadata, and outline_level headings. Default: false (all deterministic sources only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.21.2
    • changedInput schema / properties / include_heuristic_headings / description
      Previous value: -"When true, also include heuristically-detected headings (manual title / run-in / centered-caps) alongside Word HeadingN styles. Default: false (style-based only)."New value: +"When true, also include heuristic title/run-in/centered-caps headings alongside deterministic word_style, list_metadata, and outline_level headings. Default: false (all deterministic sources only)."
  2. Addedv0.16.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true and destructiveHint=false; the description goes well beyond that by disclosing the entry shape, the deterministic source list with precedence order, the heuristic source list, the opt-in default for heuristics, and the JSON-vs-Markdown level-clamping difference. The only shortfall is that it doesn't mention pagination or size limits for large documents.

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?

Purpose comes first, then output shape, then source semantics, then format caveats — a sensible front-loaded order. It is dense and uses unexplained identifiers like `run_in_header` and `title_with_period`, but no sentence is purely filler.

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 explaining return values, and it does: entry fields, the conditional `list_label`, and the Markdown rendering differences. Given a simple read-only three-parameter tool, an agent has everything needed to call it correctly and interpret the result.

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 the baseline is 3, but the description adds real meaning: it enumerates the five heuristic sources that include_heuristic_headings actually enables and states that deterministic sources are applied in precedence order, details the schema only summarizes. The Markdown label-before-text convention further clarifies format semantics.

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 opens with a specific verb and resource: 'Get a compact structural map of a document's headings', scoped to DOCX only. That scope makes it distinguishable from general readers like read_file or get_sections, though it never names an alternative sibling to route the agent away from.

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?

Usage is only implied: an agent is expected to infer that this tool is for structural/navigation purposes and that include_heuristic_headings is set when deterministic sources miss headings. There is no explicit when-to-use/when-not statement and no comparison with read_file, get_sections, or grep.

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