Skip to main content
Glama

Extract Text from a PDF

pdf_to_text
Read-onlyIdempotent

Extract the text from a PDF file at a URL and return it as markdown, page by page. Use it to read a PDF, parse a form, report, paper, invoice, or document, or convert a PDF to text. Works on PDFs with a text layer (scanned image-only PDFs return little or no text; no OCR). Price: $0.005 per successful call; failed calls are free. Free to try: a few calls a day without a key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe http(s) URL of the PDF file.
api_keyNoYour Unstuck API key, if this connection has none. Leave empty to try free tools or to get a key and payment link.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesPDF URL after redirects.
bytesYesFile size in bytes.
pagesYesNumber of pages.
titleYesTitle from the PDF metadata, if any.
markdownYesText as markdown, one "## Page N" section per page.
truncatedYesTrue if the text was cut at the size limit.
balance_usdYesRemaining prepaid balance, USD.
charged_usdYesAmount charged for this call, USD.
likely_scannedYesTrue if the PDF looks image-only (little extractable text).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / api_key
      Added value: +{
      +  "description": "Your Unstuck API key, if this connection has none. Leave empty to try free tools or to get a key and payment link.",
      +  "maxLength": 200,
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), and the description adds genuinely new behavioral facts: the text-layer limitation with no OCR fallback, the $0.005 per successful call price, free failures, and a keyless free trial tier. That is real context an agent cannot get from the annotations or schema.

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 tight sentences, front-loaded with the action and output format, followed by applicability, a hard limitation, and cost/auth terms. No filler and nothing buried that an agent needs to decide whether to call.

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?

An output schema exists, so return-value documentation is not required, yet the description still names the markdown/page-by-page format. Combined with the OCR limitation, pricing, and auth notes, an agent has everything needed to call this correctly or route elsewhere.

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% for both parameters, including maxLength constraints, so the structured fields already do the work. The description only implies the URL input and hints at keyless usage via the free-tier note; it adds no syntax or format detail beyond the schema. Baseline 3 applies.

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 ('Extract the text from a PDF file at a URL') plus the output shape ('return it as markdown, page by page'). This distinguishes it cleanly from siblings like read_page and screenshot, which operate on web pages rather than PDFs.

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?

Provides concrete use cases ('read a PDF, parse a form, report, paper, invoice, or document, or convert a PDF to text') and an explicit when-not condition: scanned image-only PDFs are unsupported because there is no OCR. It stops short of naming a sibling alternative, but the usage envelope is unambiguous.

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