Skip to main content
Glama

PDF Efforts

Extract text from PDF

pdf_to_text
Idempotent

Extract the plain text of a PDF that has a text layer. The text is returned inline (up to 200,000 characters) and as a .txt file. For scans without text, use ocr_pdf.

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

Input Schema

NameRequiredDescriptionDefault
fileYesThe PDF.
page_markersNoInsert "[Page n]" markers between pages.

Output Schema

NameRequiredDescriptionDefault
infoNoFacts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf).
noteNoAnything the user should know about the result.
textNoExtracted text (pdf_to_text, ocr_pdf).
filesYesResult files. Download them before expires_at; pass file_id to another tool to chain.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing the result shape (inline text capped at 200,000 characters, plus a .txt file) and the hard prerequisite of an existing text layer. The annotations already cover openWorld/idempotent/non-destructive, and an output schema exists, so remaining behavioral risk is low; the description adds the payload-size limit that annotations cannot express.

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?

Two sentences, front-loaded with the core action, the following sentence carrying the output-size limit and the routing rule. Nothing is redundant or padded.

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 two-parameter extraction tool with full schema coverage, annotations, and an output schema, the description supplies exactly the pieces structured fields cannot: the text-layer prerequisite, the 200k inline cap with file fallback, and the OCR sibling routing.

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%, with per-field descriptions for url, base64, file_id, filename and page_markers, so the schema does the heavy lifting. The description adds no parameter-level meaning (e.g., that page_markers inserts "[Page n]" lines or which file source is preferred), so the 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 plain text of a PDF") plus a qualifying scope ("that has a text layer"), and contrasts it with the sibling ocr_pdf. An agent can distinguish it from every conversion sibling 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 Guidelines5/5

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

Explicitly names the alternative and the condition that selects it: "For scans without text, use ocr_pdf." That gives a clear when-to-use and when-to-use-something-else rule with no inference required.

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