Skip to main content
Glama

Extraer texto de un PDF

read_pdf
Read-only

Extract text from a PDF at a direct URL, optionally by page range, to analyze Ecuador open government data. Scanned PDFs return empty because OCR is not supported.

Instructions

Extract text from a PDF at a direct URL (max 5 MB, 20 pages per call; pages selects a range). No OCR: scanned PDFs come back empty.

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": {
      "url": "<url>"
    },
    "name": "read_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesDirect URL to the PDF file
pagesNoPage range, 1-indexed (e.g. "3", "1-5", "1,4,9").
formatNotext summary (default) or json structured result.text

Output Schema

NameRequiredDescriptionDefault
sourceNo
metadatosYes
url_fuenteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.15.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "metadatos": {
      +      "properties": {
      +        "contrato": {
      +          "const": "ecudatamcp.response.v1"
      +        }
      +      },
      +      "required": [
      +        "contrato"
      +      ],
      +      "type": "object"
      +    },
      +    "source": {},
      +    "url_fuente": {}
      +  },
      +  "required": [
      +    "metadatos"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changedv0.13.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  3. Changed3 schema fields changedv0.10.0
    • addedInput schema / properties / format / description
      Added value: +"text summary (default) or json structured result."
    • addedInput schema / properties / pages / description
      Added value: +"Page range, 1-indexed (e.g. \"3\", \"1-5\", \"1,4,9\")."
    • addedInput schema / properties / url / description
      Added value: +"Direct URL to the PDF file"
  4. Changed5 schema fields changedv0.8.14
    • removedInput schema / properties / format / title
      Removed value: -"Format"
    • removedInput schema / properties / pages / title
      Removed value: -"Pages"
    • removedInput schema / properties / url / title
      Removed value: -"Url"
    • removedInput schema / title
      Removed value: -"read_pdfArguments"
    • removedOutput schema / title
      Removed value: -"read_pdfDictOutput"
  5. First observedv0.8.12

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare read-only, non-destructive and open-world access, so the description's job is to add operating constraints — and it does: 5 MB max size, 20 pages per call, and the critical no-OCR caveat that makes scanned inputs silently return empty. It stops short of describing failure behavior for unreachable or password-protected URLs, which would complete the picture.

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?

A single dense sentence that front-loads the verb and resource, then appends the limits and the OCR caveat in order of operational importance. No filler, and the most important warning (empty results on scanned PDFs) is placed where it will be read before invoking.

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 three parameters, full schema coverage and an output schema, the description covers what an agent needs to call it correctly, including the size/page ceilings that drive pagination decisions. It omits how errors surface for bad URLs or how the text is segmented across pages, minor gaps given the output schema exists.

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%, so url, pages and format are all documented with examples and defaults. The description only restates that pages selects a range, adding essentially nothing beyond the schema, so the baseline of 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 text from a PDF") plus the required input form ("direct URL"), which cleanly separates it from siblings like read_zip_member that handle archived members. An agent knows exactly what the tool produces (text or json) without opening the schema.

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?

The description gives an explicit exclusion — scanned PDFs return empty because there is no OCR — which is the main failure mode an agent must anticipate. It also implies the per-call ceiling (20 pages) to signal when to paginate, but it never names an alternative tool for PDFs embedded in archives or for OCR workflows.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools