Skip to main content
Glama

PDF to text

pdf_to_text
Read-only

Read a PDF from a URL as text, page by page, with its title, author and page count. Works on text-layer PDFs up to 25 MB and 300 pages; scanned PDFs without a text layer are refused at no charge.

$0.005 USDC per call over x402. Failed calls cost nothing. Call without payment to get a quote.

When to use: The link is a PDF (a filing, paper, contract or manual) and you need its text. Use instead: read_page for an ordinary web page. Parameters: url: absolute http(s) URL of the PDF. max_pages: read at most this many pages, 1-300, default 50. Returns: title, author, page_count, pages_read and pages[] of text in order. Scanned PDFs with no text layer are refused at no charge.

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": {
      "url": "<url>"
    },
    "name": "pdf_to_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesAbsolute http(s) URL of a PDF.
paymentNoBase64 x402 payment payload. Omit it to receive a quote; sign that and call again.
max_pagesNoRead at most this many pages (default 50).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give readOnlyHint and openWorldHint, but the description adds the traits that actually matter for calling: hard limits (25 MB, 300 pages), scanned-PDF rejection behavior, per-call price ($0.005 USDC via x402), no charge on failure, and the quote-then-sign payment handshake. That is substantive behavior beyond the structured fields.

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?

Well front-loaded and scannable with labeled When to use / Use instead / Parameters / Returns sections. It loses a little to redundancy: the scanned-PDF-refused-at-no-charge fact appears twice, and the pricing sentence is split awkwardly from the call flow.

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

Completeness5/5

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

Despite no output schema, the description names every returned field and their ordering, covers the refusal case, the size/page limits, and the payment protocol. Nothing an agent needs in order to call this correctly or interpret the result is missing.

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 url, payment and max_pages are already documented structurally; the description's 'url: absolute http(s) URL' and 'max_pages: 1-300, default 50' largely restate them. The one addition is framing the omit-payment-first quote flow as part of the call sequence, which the payment field description already implies, so baseline 3 fits.

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?

States a specific verb and resource ('Read a PDF from a URL as text, page by page') plus the payload it returns (title, author, page count). It also names the sibling it is not (read_page for ordinary web pages), so an agent can route without opening either schema.

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

Usage Guidelines5/5

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

Explicit 'When to use' condition (the link is a PDF: filing, paper, contract, manual) and an explicit 'Use instead' pointer to read_page. The eligibility boundaries (text-layer only, 25 MB / 300 page caps) further constrain when it applies.

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.