Skip to main content
Glama

Extract PDF text

pdf_text_extract
Read-only

Extract text from text-based PDFs via URL or base64 data, with optional forwarded headers and character limits. Pull readable PDF content for AI workflows when OCR is not needed.

Instructions

Extract text from a PDF: url or base64 data. No OCR — text-based PDFs only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPDF URL (alt. to data).
dataNoBase64 PDF, ≤5MB decoded (alt. to url).
headersNoHeaders to forward (Authorization, Cookie…).
maxCharsNoDefault 20000, max 100000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.1
    • addedInput schema / properties / data
      Added value: +{
      +  "description": "Base64 PDF, ≤5MB decoded (alt. to url).",
      +  "type": "string"
      +}
    • addedInput schema / properties / headers
      Added value: +{
      +  "description": "Headers to forward (Authorization, Cookie…).",
      +  "type": "object"
      +}
    • changedInput schema / properties / maxChars / description
      Previous value: -"Max characters to return (default 20000, max 100000)."New value: +"Default 20000, max 100000."
    • changedInput schema / properties / url / description
      Previous value: -"URL of the PDF to fetch (http/https). Must be a PDF file."New value: +"PDF URL (alt. to data)."
    • removedInput schema / required
      Removed value: -[
      -  "url"
      -]
  2. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

readOnlyHint=true already tells the agent this is a safe read, so the description doesn't need to restate safety. The 'no OCR' constraint is the one real behavioral disclosure it adds. It says nothing about what happens when output exceeds maxChars — whether text is truncated silently, errors, or is paginated — which is the main behavioral question for this tool.

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, front-loaded with the action and followed by the key limitation. Nothing extraneous, though the telegraphic style ('url or base64 data') reaches slightly below the level of specification a caller needs.

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?

A four-parameter tool with a nested headers object and no output schema needs the description to explain truncation/maxChars behavior and dual-input precedence; neither is covered. The no-OCR constraint is the only real gap-filler here, leaving the definition adequate but incomplete for correct invocation.

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 all four parameters including the 5MB decoded limit and maxChars default/max are already documented. The description echoes the url/base64 duality without adding format or precedence detail (e.g., what happens if both are supplied), so the baseline 3 applies.

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?

States a specific verb and resource ('Extract text from a PDF') and immediately names accepted input forms (url or base64 data). It implicitly separates itself from fetch_html/html_to_markdown by naming the PDF format, but never explicitly distinguishes itself from fetch_extract, which is the closest sibling.

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 'No OCR — text-based PDFs only' clause gives a genuine exclusion criterion, which is valuable. However, no alternative is named for scanned/image PDFs (e.g., screenshot_url or fetch_extract), so an agent hitting that case is left to guess the fallback.

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