Skip to main content
Glama

PDF text extraction

pdf_text
Read-onlyIdempotent

Extract text per page from a PDF given by public URL or base64 (max 4 MiB, 100 pages). No OCR: scanned PDFs are flagged as likely_scanned. Price: 0.02 USDC per successful call on Base via x402 (pass the signed payment in _meta['x402/payment']; failed calls are not charged). HTTP equivalent: POST https://json-canon-x402.fly.dev/v1/pdf-text.

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

Input Schema

NameRequiredDescriptionDefault
urlNoPublic http(s) URL of the PDF (max 4 MiB, 3 redirects, public IPs only).
pagesNo1-based pages to read. Default: all (up to max_pages).
joinedNoAlso return all pages joined in 'text'.
max_pagesNo
pdf_base64NoAlternative to 'url': base64 PDF bytes (max 4 MiB decoded).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare this a safe, idempotent, open-world read, so the description is not obliged to restate safety; instead it adds substantive behavior the schema cannot express — size/page limits, graceful degradation for scanned input, and per-call billing semantics. Payment requirements (0.02 USDC on Base via x402, signed payment in _meta['x402/payment'], charged only on success) are exactly the kind of operational detail an agent cannot guess.

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?

Three dense sentences with no filler: capability and input modes first, then the OCR caveat and limits, then pricing and the HTTP equivalent. Nothing is repeated from the schema and nothing is padding.

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?

For a five-parameter, no-output-schema extraction tool, the description covers the dimensions that matter: input forms, hard limits, failure-mode behavior, cost, authentication mechanism and a non-MCP fallback endpoint. Nothing needed to invoke it correctly or budget for it is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 80%, so the baseline is 3 and the schema already handles url, pages, joined, max_pages and pdf_base64. The description earns above baseline by documenting a parameter that is not in the schema at all — the x402 payment token passed in _meta — plus the public-IP/size constraint on the URL input.

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 names a specific verb and resource ('Extract text per page from a PDF') and two accepted input modes (public URL or base64), with a clear scope constraint ('No OCR'). It never names a sibling such as pdf_tables, so the agent must infer that table extraction lives elsewhere; the tool purpose itself is nonetheless unambiguous.

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 operating context: 4 MiB and 100-page ceilings, the fact that scanned PDFs are returned flagged as likely_scanned rather than failing, and that failed calls are not charged. It stops short of explicit when-to-use-versus-alternatives routing, which is the only missing piece.

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.

Resources