Skip to main content
Glama
PDF MCP Server

PDF MCP Server

by johan-gorter

extract_pdf_text

Extract embedded text from PDF files and optionally cap returned characters to control output size and prevent context overflow.

Instructions

Extract text content from PDF files with optional character limiting. This tool reads PDF files and extracts their text content. Supports limiting the output size via max_chars parameter to prevent context overflow. Only works with PDF files containing embedded text - scanned PDFs without OCR won't work. Only works within allowed directories.

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

Input Schema

NameRequiredDescriptionDefault
pathYesPath to PDF file within allowed directories
max_charsNoMaximum characters to return (default: unlimited)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well: it discloses that the operation is a read/extraction, that output can be truncated via max_chars to prevent context overflow, and that it fails for scanned PDFs and out-of-scope paths. It does not say what happens on truncation (silent cut vs. flag) or how errors are surfaced, leaving a residual gap.

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 first sentence is front-loaded and informative, but the second sentence ('This tool reads PDF files and extracts their text content') largely restates the first and could be cut. The remaining sentences each carry distinct constraints, so overall waste is minor.

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 two-parameter extraction tool with no annotations and no output schema, the description covers purpose, preconditions, and the main limitation (lack of OCR). The main missing piece an agent would want is the return shape and truncation behavior, but the essentials for correct invocation are present.

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%, so both parameters are already documented, giving a baseline of 3. The description adds only the rationale that max_chars prevents context overflow, without explaining truncation semantics or guidance on choosing a value.

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 ('Extract text content from PDF files') plus the differentiating capability of character limiting. It is immediately distinguishable from the only sibling, list_allowed_directories, so an agent can select it 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?

It gives explicit negative guidance: only PDFs with embedded text, scanned PDFs without OCR won't work, and paths must be within allowed directories. It stops short of naming concrete alternatives (e.g., checking list_allowed_directories first) or what to do when a PDF has no embedded text, so it is strong context without explicit routing.

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