Skip to main content
Glama

extract_sections

Extract named sections like Abstract and Results from a local PDF using heading heuristics. Reports unmatched sections, so you know what is missing without failing the request.

Instructions

Return named sections from a local PDF using heading heuristics.

Not a trained parser: headings are matched case-insensitively with aliases (e.g. Methodology ≡ Methods ≡ Materiais and Methods; Abstract ≡ Resumo). Missing sections are listed in unmatched; they do not fail the tool.

Status values: ok, file_not_found, parse_error, invalid_path. Does not fetch URLs — pdf_path must already exist in the workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdf_pathYesWorkspace-relative path to a previously downloaded PDF.
sectionsYesLabels to extract, e.g. `["Abstract", "Methodology", "Results"]`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
messageNo
pdf_pathYes
sectionsNo
unmatchedNo
error_codeNo
Behavior4/5

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

With no annotations, the description carries full burden. It discloses key behavioral traits: heading matching is case-insensitive, aliases exist (e.g., Methodology ≡ Methods), missing sections are listed in `unmatched`, status values are enumerated, and it never fetches URLs. It does not, however, describe the output schema in detail, but later output schema may exist. The behavioral notes are substantial and go beyond basic trust.

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?

Four compact paragraphs, each earning its place. First line states purpose, second explains the heuristic nature, third lists status values, fourth states a critical constraint. No fluff, front-loaded with the core action, and structured for quick skimming.

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 has an output schema (implied), so return format is covered. Key operational details are present: matching behavior, status values, and the URL restriction. A slight gap: it doesn't explicitly mention the output structure (e.g., section content vs. just match status), but since output schema exists and the description is otherwise thorough, this is minor. Given the complexity, covers nearly all needed information.

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 coverage is 100%, so the schema already documents both parameters. The description adds useful alias semantics: it explains that headings are matched with aliases and gives examples, which enriches `sections`. It also clarifies that `pdf_path` is workspace-relative and must already exist. This goes beyond bare schema, adding practical usage context.

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 the action ('Return named sections'), the resource ('local PDF'), and the method ('heading heuristics'). Clearly distinguishes from siblings like search_papers (searching) and download_and_parse_paper (downloading + parsing) by scoping to extracting sections from an existing local PDF. The description leaves no ambiguity about its core function.

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?

Explicitly says what it does not do: 'Does not fetch URLs — `pdf_path` must already exist in the workspace.' This prevents misuse when the agent might think it can download. It also clarifies that missing sections do not fail the tool, guiding the agent on expected behavior. Alternatives are not named, but the functional boundary is clearly drawn.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/benetche/ares-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server