Skip to main content
Glama

pdf_extract_text

Extracts raw text from PDF files and saves it as plain text, with optional page selection.

Instructions

Extracts raw text from a PDF. [Input: PDF (.pdf) | Output: Plain Text (.txt)]

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>",
      "output": "<output>"
    },
    "name": "pdf_extract_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesThe input PDF file path.
pagesNoPages to extract text from, e.g., '1,3,5-7' or 'all'.
outputYesThe output text file path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses little beyond the surface action. It does not say whether an existing output file is overwritten, how layout/encoding is handled, or what happens with encrypted or scanned PDFs, all of which matter for a tool that writes a file.

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 short sentences with the action front-loaded and the input/output contract bracketed for fast scanning. Nothing is wasted, though the format line is largely redundant with the schema's own field descriptions.

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?

For a simple three-parameter extraction tool with no output schema this is minimally viable, but the absence of annotations and any note on overwrite behavior, scanned PDFs, or failure modes leaves real gaps. An agent could call it, but not confidently predict edge-case behavior.

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%, so the schema already documents input, pages, and output, giving a baseline of 3. The description reinforces the input/output file types but says nothing about the pages selector (e.g., how 'all' vs '1,3,5-7' behaves), so it adds no meaning beyond the schema.

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 gives a specific verb and resource ("Extracts raw text from a PDF") plus an input/output format contract, so the agent knows exactly what it produces. It does not, however, distinguish itself from close siblings like pdf_extract_pages, pdf_extract_patterns, or pdf_extract_tables, leaving the agent to infer the difference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to choose this over pdf_extract_pages or pdf_extract_tables, nor any exclusion of scanned/image-only PDFs where extraction may return nothing. The only implied usage is the input/output format line.

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