Skip to main content
Glama

PDF to Text API - extract text from PDF (OCR for scans)

pdf_to_text
Read-onlyIdempotent

Extract the text of a PDF with page markers. Scanned pages are read with OCR (English, German, Bulgarian; first 5 scanned pages per call). Runs on our server, files are deleted right after the call, nothing stored. Free: 25 calls/day per IP. Paid: $0.005 per call via x402 at https://radarbg.com/x402/pdf-to-text.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fileName": "sample.pdf",
      "fileContent": "JVBERi0xLjMKJenr8b8KMSAwIG9iago8PAovQ291bnQgMQovS2lkcyBbMyAwIFJdCi9NZWRpYUJveCBbMCAwIDU5NS4yOCA4NDEuODldCi9UeXBlIC9QYWdlcwo+PgplbmRvYmoKMiAwIG9iago8PAovT3BlbkFjdGlvbiBbMyAwIFIgL0ZpdEggbnVsbF0KL1BhZ2VMYXlvdXQgL09uZUNvbHVtbgovUGFnZXMgMSAwIFIKL1R5cGUgL0NhdGFsb2cKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL0NvbnRlbnRzIDQgMCBSCi9QYXJlbnQgMSAwIFIKL1Jlc291cmNlcyA2IDAgUgovVHlwZSAvUGFnZQo+PgplbmRvYmoKNCAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDExMgo+PgpzdHJlYW0KeJwzUvDiMtAzNVco53IKUdB3M1QwNNIzMFAISVNwDQEJGRvqGVoomFua6pmbK4SkKGh45pXlZyanKhgZGJnpGhgYKrhWJOYW5KQq+JSkaCqEZKHqMzPXMzEC6wvJL0nMAZpuADLeNTQIphYAsdgfAQplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKPDwKL0Jhc2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcKL1N1YnR5cGUgL1R5cGUxCi9UeXBlIC9Gb250Cj4+CmVuZG9iago2IDAgb2JqCjw8Ci9Gb250IDw8L0YxIDUgMCBSPj4KL1Byb2NTZXQgWy9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUldCj4+CmVuZG9iago3IDAgb2JqCjw8Ci9DcmVhdGlvbkRhdGUgKEQ6MjAyNjExMTUyMDEzNTRaKQo+PgplbmRvYmoKeHJlZgowIDgKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAxMDIgMDAwMDAgbiAKMDAwMDAwMDIwNSAwMDAwMCBuIAowMDAwMDAwMjg1IDAwMDAwIG4gCjAwMDAwMDA0NjkgMDAwMDAgbiAKMDAwMDAwMDU2NiAwMDAwMCBuIAowMDAwMDAwNjUzIDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgOAovUm9vdCAyIDAgUgovSW5mbyA3IDAgUgovSUQgWzwyMzc0NENDOUY1ODJDN0FCMkFGMjQ5MDVFRTQ3RjgzNz48MjM3NDRDQzlGNTgyQzdBQjJBRjI0OTA1RUU0N0Y4Mzc+XQo+PgpzdGFydHhyZWYKNzA4CiUlRU9GCg=="
    },
    "name": "pdf_to_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoOr several files: [{fileName, fileContent (base64)}]
fileNameNoFile name with extension, e.g. report.pdf
languageNoOCR language for scanned pageseng
pageMarksNoInsert a line with the page number
fileContentNoThe file as base64 (a data: URI is fine)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

Beyond the readOnly/openWorld/idempotent annotations, the description discloses what actually matters for calling this: OCR runs in English, German and Bulgarian, only the first 5 scanned pages per call are processed, files are deleted immediately and nothing is stored, and there are concrete rate limits (25 free calls/day per IP) plus a per-call price. These are operational facts the annotations do not carry.

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 what the tool does, then OCR constraints, then data handling, then cost. Every sentence carries information an agent would otherwise have to discover at runtime, with no filler.

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 5-parameter, zero-required-parameter tool with no output schema, the description covers behavior, limits and pricing well, and 'text of a PDF with page markers' gives a reasonable return hint. The remaining gap is that it never clarifies the single-file versus 'files' array choice or what happens to scanned pages beyond the fifth.

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 the schema already documents fileName, fileContent, language, pageMarks and files; baseline is 3. The description reinforces page markers and ties OCR languages to the scored language list, but adds no new syntax or format guidance, and it does not explain when to use the 'files' array instead of the single-file parameters.

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 opens with a concrete verb and resource: 'Extract the text of a PDF with page markers', and adds that scanned pages go through OCR. It does not name the closely related sibling pdf_ocr, so the agent cannot tell from the text alone which of the two to pick, which keeps it out of 5 territory.

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?

Usage context is implied rather than stated: text extraction from PDFs, including scans, with a five-scanned-page cap and a daily quota that implicitly route heavy or scan-only workloads elsewhere. There is no explicit when-to-use/when-not-to-use statement and no named alternative such as pdf_ocr, so the agent must infer selection.

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