Skip to main content
Glama

Index a document by section

distill_outline
Read-onlyIdempotent

Index a local document into a table of contents with line ranges, page numbers and token counts, so you can read only the sections you need with distill_file. Read-only; never modifies or uploads the file.

Instructions

Index one local document (same formats as distill_file) without reading it: a table of contents with line ranges, page numbers and token counts per section. Read-only: never modifies or uploads the file. Call it first for long documents, then read only what you need with distill_file using section or offset/limit. Line numbers refer to the converted Markdown, not to the original file. Small and unstructured documents get a single entry. Pages listed in visualPages contain charts or images that are not in the text; if the question depends on them, view the original page with distill_page_image. visualPages[].page is the physical page number (1-based position in the PDF); label is the printed page label, only present when it differs. Fails like distill_file (password_protected, needs_libreoffice, forbidden, too_large over 100 MB for documents, 2 GB for audio and video, parse_failed).

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": {
      "path": "<path>"
    },
    "name": "distill_outline"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path, or relative to the server's working directory
linguaNoOptional LLMLingua-2 compression, lossy: it removes words. Only works when installed (see distill_capabilities); avoid it for contracts and other exact text
boostersNoLossless cleanups to apply, default all: dedupe (repeated headers and footers), media (shorter image paths and link URLs), tables (removes padding), ws (collapses whitespace). Pass a subset to keep, for example, link URLs

Output Schema

NameRequiredDescriptionDefault
kindYes
noteNo
linesYes
pagesYes
tokensYes
entriesYes
outlineYes
visualPagesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/destructive annotations it discloses that the file is never uploaded, that line numbers refer to converted Markdown rather than the source file, that small/unstructured documents collapse to one entry, that visualPages entries map physical page numbers to printed labels, and it enumerates the failure modes and size limits (100 MB documents, 2 GB audio/video). This is unusually rich behavioral context for a read-only tool.

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 before caveats, then usage, then edge-case semantics, then failure modes — a sensible order with no filler sentences. It is dense and slightly long, and "Read-only: never modifies or uploads the file" partly restates the annotation, but the rest earns its space.

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 an output schema present, the description needn't explain return values, yet it still clarifies the non-obvious parts agents get wrong: Markdown-based line numbering, the visualPages page/label distinction, and the error taxonomy. Complete for a 3-parameter indexing tool.

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 100%, so path, lingua and boosters are already documented, and the description adds nothing about them — in fact the only parameter names it mentions (section, offset/limit) belong to distill_file, not this tool, which could momentarily confuse. Baseline 3 applies when the schema carries parameter semantics.

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 (index one local document) and immediately specifies the returned artifact: a table of contents with line ranges, page numbers and token counts per section. It also distinguishes itself from siblings by naming distill_file for reading and distill_page_image for visual pages.

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?

Gives explicit ordering guidance ("Call it first for long documents, then read only what you need with distill_file using section or offset/limit") plus the when-not case ("Small and unstructured documents get a single entry") and the escalation path when content is visual (view the original page with distill_page_image). Nothing is left to inference.

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