Skip to main content
Glama

Extract PDF text

extract_pdf_text
Read-onlyIdempotent

Read the selectable text layer of a PDF. Returns per-page text, markdown-style headings, and an o200k token count. Does not OCR scans. Send base64 or a public URL. Private addresses are refused.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "extract_pdf_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPublic URL of a PDF. Private and local addresses are refused. Provide data or url.
dataNoPDF bytes as base64 or a data URI. Decoded size is capped at 10 MB. Provide data or url.
filenameNo
mimeTypeNo

Output Schema

NameRequiredDescriptionDefault
textYes
pagesYes
tokensYes
markdownYes
pageCountYes
emptyPagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnly/openWorld/idempotent annotations, it discloses the return shape (per-page text, markdown headings, o200k token count), the OCR limitation, and the private-address refusal policy. Missing only things like rate limits or handling of empty/encrypted text layers, but the substantive behavior is covered.

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 short sentences, front-loaded with the core action, then return values, then the OCR exclusion and input constraints. No filler, and each sentence carries distinct information.

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 read-only extraction tool with an output schema and annotated safety profile, this covers what an agent needs: what it returns, what it refuses (scans, private addresses), and how to supply input. The main residual gap is the undocumented filename/mimeType parameters.

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 50% — url and data are documented in the schema, filename and mimeType are not. The description reinforces the data-or-url choice but says nothing about when filename or mimeType matter, so it only partially compensates for the coverage gap.

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 names a specific verb and resource ('Read the selectable text layer of a PDF') and immediately sets the scope boundary that separates it from OCR-based siblings: 'Does not OCR scans.' An agent can tell this apart from read_image_text or count_text without opening any 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 concrete input routing ('Send base64 or a public URL') and a clear exclusion ('Does not OCR scans', 'Private addresses are refused'), which is enough context to decide when this tool applies. It stops short of explicitly naming the alternative to use for scanned documents, so the routing is implied rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.