Skip to main content
Glama

PDF table of contents

pdf_toc
Read-only

Extracts a PDF's table of contents and section start pages from its outline or detected headings, so you can locate needed pages in long documents before converting them to Markdown.

Instructions

Table of contents of a PDF with the page where each section starts (from the PDF outline, else from detected headings). Use it on long PDFs (more than ~20 pages) to find the pages you need, then call pdf_to_markdown with "pages".

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": "pdf_toc"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath of the PDF file: absolute, or relative to the server's working directory.
passwordNoPassword of an encrypted PDF. Only when an error asks for it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds one genuinely useful behavioral fact, the fallback from PDF outline to detected headings, but does not say what happens when neither exists (empty result vs. error) or how page numbers are counted.

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 tight clauses with no filler, and the primary output definition is front-loaded ahead of the usage hint. Slightly dense but every element earns its place.

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?

With no output schema, the description does explain the shape of the result (section names plus start pages) and the intended follow-up call. The remaining gap is edge-case behavior when no TOC can be derived, which matters for a tool that may silently return nothing.

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% and both parameters are already documented, including the conditional rule for "password". The description adds no additional meaning about path resolution or password behavior, so the baseline 3 applies.

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+resource: the table of contents of a PDF with the start page of each section, plus the two sources it derives from (PDF outline, else detected headings). An agent can distinguish this from pdf_info (metadata) and pdf_to_markdown (content extraction) without opening the schema.

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?

Gives a concrete use condition (long PDFs, more than ~20 pages) and an explicit next step (call pdf_to_markdown with "pages"). It stops short of explicit when-not guidance, e.g. for short PDFs where the TOC adds no value, but the intended workflow is unambiguous.

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

Deploy Server

Other Tools