Skip to main content
Glama

pdf_chunk

Split PDFs into structure-aware semantic chunks with dynamic overlap for AI agents and LLM context windows, outputting JSON for downstream processing.

Instructions

Structure-aware semantic chunking with dynamic overlap for AI agents and LLM context windows. [Input: PDF (.pdf) | Output: JSON]

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": {
      "input": "<input>"
    },
    "name": "pdf_chunk"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesPath to input PDF file
outputNoOptional destination path for JSON output
target_tokensNoTarget tokens per chunk (default: 500, range: 50-4000)
overlap_tokensNoOverlap tokens between chunks (default: 50, range: 0-500)
break_on_headingsNoTrigger hard boundary split on # / ## headings (default: true)
strip_boilerplateNoStrip repetitive headers/footers across consecutive pages (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose input/output formats ('PDF (.pdf)' in, 'JSON' out) and the semantic/dynamic-overlap behavior, which is useful. It omits important behaviors: whether JSON is written to a file, returned inline, or both when 'output' is omitted, and any note about cost or size limits for large PDFs.

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 tightly packed sentences with a clear front-loaded capability statement followed by a bracketed input/output summary. Slightly promotional phrasing ('for AI agents and LLM context windows') is the only filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With six parameters, no output schema, and no annotations, the description is adequate but thin: it never describes the shape of the returned JSON chunks or where the output lands. The rich schema covers tuning parameters, so the gap is mainly around output behavior rather than inputs.

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 description coverage is 100% with six well-documented parameters including defaults and ranges, so the schema already does the heavy lifting and the baseline of 3 applies. The description adds no parameter meaning beyond the schema, not even clarifying the behavior when 'output' is omitted.

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 names a specific operation (structure-aware semantic chunking with dynamic overlap) on a specific resource (PDF) with a declared output format (JSON). An agent can tell this is a PDF-to-chunked-JSON transform. It stops short of explicitly differentiating itself from extraction siblings such as pdf_extract_text.

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?

The phrase 'for AI agents and LLM context windows' implies the intended use case (preparing PDFs for LLM consumption), which is a genuine contextual cue. However, there is no explicit when-to-use/when-not guidance and no mention of which sibling to prefer for plain text extraction versus chunking.

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