Skip to main content
Glama
pdf2mcp

pdf2mcp

by iSamBa

get_sections

Retrieve a PDF's table of contents and numbered section headings in document order to understand its structure before reading or searching specific sections.

Instructions

Get the table of contents (section headings) of a document.

Use this to understand a document's structure before diving in.
Returns numbered section titles in document order. Then use read_section
to read any section, or search_in_doc to search within the document.

Get valid filenames from list_docs first.

Args:
    filename: The PDF filename (e.g., 'manual.pdf').

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_sections"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are supplied, so the description must carry behavioral weight: it discloses that output is numbered section titles in document order and that the filename must come from list_docs, implying read-only behavior and a dependency chain. It does not describe failure modes for invalid filenames or behavior on documents with no headings, which keeps it below a 5.

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?

The purpose is front-loaded in the first sentence, followed by usage context and next steps, so an agent can act after one line. The trailing 'Args:' block is slightly redundant with the body and could be trimmed, but overall there is little waste.

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?

For a one-parameter read tool with an output schema, the description covers purpose, prerequisite sourcing, and follow-up actions, which is sufficient to call it correctly. Only edge-case behavior such as invalid filenames or empty documents is unaddressed.

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 description coverage is 0%, so the description must define the single parameter, and it does — the filename is a PDF filename with an example format, and valid values come from list_docs. That adds meaningful sourcing and format context beyond the bare 'filename' schema field.

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 states a specific verb and resource — 'Get the table of contents (section headings) of a document' — and immediately clarifies what is returned (numbered section titles in document order). This distinguishes it cleanly from siblings like read_section and search_in_doc, which are named as different actions.

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?

It gives explicit when-to-use guidance ('understand a document's structure before diving in'), names the follow-up alternatives (read_section, search_in_doc) and the prerequisite (get valid filenames from list_docs first). Nothing about tool selection 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.