Skip to main content
Glama

get_document_structure

Extract a document's hierarchical outline—headers, sections, and page references—to locate relevant parts before reading specific pages. Ideal for documents over 20 pages.

Instructions

Extract a document's hierarchical outline (headers, sections, page references). REQUIRED for documents over 20 pages — call this first to locate relevant sections, then pass their page numbers to get_page_content(). Use the part parameter to iterate large outlines until pagination.has_more is false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partNoPart number for pagination (1-based, default 1). For large outlines, increment until the response's `pagination.has_more` becomes false.
doc_nameYesCopy the `name` field verbatim from a browse_documents() or search_documents() response (case-sensitive, include extension). Example: "Q3 Report.pdf". If the response shows two documents with the same name, pass `folder_id` alongside to disambiguate.
folder_idNo
wait_for_completionNoIf true and document is processing, automatically wait up to 3 minutes until completed. Reduces repeated tool calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.8.2

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It reveals the output includes headers, sections, and page references, and exposes pagination behavior through 'pagination.has_more'. It also communicates the intended call sequence and the wait_for_completion behavior, though it does not discuss error handling or processing states.

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?

Three sentences deliver purpose, conditional usage, the follow-up action, and pagination behavior without wasted words. The most decision-relevant information is front-loaded: the extraction purpose and when it is required.

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?

The description is complete enough for an agent to decide when to call this tool, what it returns at a high level, and how to paginate. It connects the tool to get_page_content and references pagination.has_more, but without an output schema it does not fully specify the outline's exact return shape.

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

Parameters3/5

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

Schema coverage is high (75%), so the baseline is 3. The doc_name and part parameters are well described in the schema, and the description adds workflow context around part's pagination role. However, the folder_id parameter has no schema description and is not explained in the description, leaving a small coverage gap.

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 uses a specific verb and resource: 'Extract a document's hierarchical outline (headers, sections, page references).' It clearly differentiates from siblings like get_document, get_page_content, and get_folder_structure by describing the outline extraction purpose and the follow-up workflow.

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?

The description explicitly states when to use the tool: 'REQUIRED for documents over 20 pages — call this first to locate relevant sections.' It also names the follow-up tool, get_page_content(), and explains the pagination loop. It lacks an explicit when-not-to-use statement for smaller documents, but the conditional guidance strongly implies the boundary.

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