Skip to main content
Glama

get_document_outline

Read-onlyIdempotent

Extract a document's heading structure and table of contents to understand its organization before reading specific sections; detects numbered sections, ALL-CAPS headings, and Markdown headings.

Instructions

Extract the heading structure and table of contents from a document. Use this to understand document organization before reading specific sections; detects numbered sections, ALL-CAPS headings, and markdown # headings. Read-only.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

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

Input Schema

NameRequiredDescriptionDefault
filenameYesThe document filename to extract outline from

Output Schema

NameRequiredDescriptionDefault
outlineYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "outline": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "level": {
      +            "type": "integer"
      +          },
      +          "page": {
      +            "type": "integer"
      +          },
      +          "title": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "level",
      +          "title",
      +          "page"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "outline"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the trailing "Read-only" adds nothing. The genuinely useful addition is the disclosure of detection heuristics (numbered sections, ALL-CAPS headings, markdown # headings), which tells the agent what the extractor will and will not recognize; failure behavior for unsupported or missing files is unstated.

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?

Two sentences, front-loaded with the core action and followed by the usage hint and detection details. The trailing "Read-only." fragment is redundant against the annotations and is the only clear wasted element.

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 tool is simple (one parameter) and has an output schema, so return values need no explanation, and the annotations carry the safety profile. The description supplies purpose, usage context, and extraction heuristics, leaving only error/edge-case behavior uncovered.

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?

There is a single required parameter with 100% schema description coverage, so the schema already explains the filename argument. The description adds no format, path, or resolution semantics beyond it, which is the baseline expectation at full coverage.

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 pairs a specific verb ("Extract") with a specific resource ("heading structure and table of contents"), which is far more precise than the tool name alone. The phrase "before reading specific sections" implicitly separates it from read_document and get_document_summary, though neither sibling is named directly.

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?

It suggests a usage context ("before reading specific sections") which implies a workflow ordering relative to read_document. However, there are no explicit exclusions, no named alternative such as get_document_summary for cases where a summary rather than an outline is wanted, and no stated prerequisites.

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