Skip to main content
Glama

PDF to Markdown

read_pdf
Read-onlyIdempotent

Extract a public PDF (by HTTPS URL or base64) into clean Markdown - headings and tables preserved via layout-aware parsing, plus title/author/page count/date metadata and a real token count. Text content itself is never generated or altered, only its structure is inferred. Try GET /pdf/sample. Part of the AgentIndex content kit (pdf, web-read, extract, summarize, detect-language) - see GET /capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoPublic HTTPS URL of a PDF file. Provide this or pdf_base64, not both.
pdf_base64NoBase64-encoded PDF file content. Provide this or url, not both.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesExtracted Markdown - headings and tables preserved via layout-aware parsing.
metadataYes
token_countYesReal BPE token count (cl100k_base) of the extracted markdown.
x402_receiptNoBilling and provenance receipt for this call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / pdf_base64 / description
      Added value: +"Base64-encoded PDF file content. Provide this or url, not both."
    • addedInput schema / properties / url / description
      Added value: +"Public HTTPS URL of a PDF file. Provide this or pdf_base64, not both."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "markdown": {
      +      "description": "Extracted Markdown - headings and tables preserved via layout-aware parsing.",
      +      "type": "string"
      +    },
      +    "metadata": {
      +      "properties": {
      +        "author": {
      +          "description": "Document author from PDF metadata, when present."
      +        },
      +        "date": {
      +          "description": "Document creation date from PDF metadata, when present."
      +        },
      +        "pages": {
      +          "description": "Number of pages in the PDF.",
      +          "type": "integer"
      +        },
      +        "title": {
      +          "description": "Document title from PDF metadata, when present."
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "token_count": {
      +      "description": "Real BPE token count (cl100k_base) of the extracted markdown.",
      +      "type": "integer"
      +    },
      +    "x402_receipt": {
      +      "description": "Billing and provenance receipt for this call.",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "markdown",
      +    "metadata",
      +    "token_count"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, openWorldHint), yet the description adds real behavioral context: text is never generated or altered, only structure is inferred, and the parse is layout-aware. It leaves resource limits (size, page caps, timeouts) and rate/error behavior unstated, which an agent would want for a bounded call.

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?

Purpose and key behavior are front-loaded in the first clause, and the no-alteration guarantee is a high-value second sentence. The trailing sample-endpoint note and kit/capabilities promotion are useful orientation but slightly dilute an otherwise tight definition.

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?

With an output schema present and annotations covering safety, the description need not explain return values, and it does supply source constraints and parsing behavior. Minor gaps remain around non-public PDFs and operational limits, but nothing essential for invocation 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 description coverage is 100%, so the schema already documents url vs pdf_base64 and their mutual exclusivity. The description restates the same two source modes without adding format, size, or precedence detail beyond the schema — baseline 3 is appropriate.

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+resource (extract a PDF into clean Markdown) and names the source types (HTTPS URL or base64), the structural fidelity (headings/tables preserved), and the metadata returned. It also distinguishes itself from read_web_page/extract_structured by scoping to PDFs and by naming the content-kit siblings.

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?

Clear context: only public PDFs, supplied either by URL or base64, with a sample endpoint to try. It lists the sibling tools in the kit (pdf, web-read, extract, summarize, detect-language) so an agent can route roughly, but gives no explicit when-not-to-use rule or which sibling to pick for a given task.

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.