Skip to main content
Glama

read_file

Read-only

Download and extract text or tables from Moodle campus PDFs, DOCX, PPTX, XLSX, ODT, ODS, RTF, EPUB, and plain text files, with pagination and optional local OCR for PDF images.

Instructions

Descarga y extrae texto/tablas de PDF, DOCX, PPTX, XLSX, ODT, ODS, RTF, EPUB y texto. PDFs admiten page, fragmentos con offset y OCR opcional solo con modelos Tesseract locales; por defecto no ejecuta OCR ni descarga modelos. full: true devuelve el documento completo (hasta 150.000 caracteres) sin paginar. En los PDF las tablas se reconstruyen con sus columnas (layout: false lo desactiva). Si la URL es una carpeta, usá open para obtener la URL de cada archivo.

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_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
ocrNoSolicita OCR local para imagenes PDF; requiere modelos Tesseract locales y nunca los descarga.
urlYesURL del recurso o archivo en el Campus Virtual (ej: /mod/resource/view.php?id=... o /pluginfile.php/...)
fullNotrue devuelve el documento completo en una sola respuesta (hasta 150.000 caracteres) en vez de fragmentos de 8.000; si todavía se trunca, continuar con offset.
pageNoNúmero de página o fragmento a leer, inicia en 1
formatNoSalida extraída: markdown conserva tablas; text y raw devuelven texto plano, no bytes binarios.
layoutNoPDF: true (por defecto) reconstruye las tablas con sus columnas y celdas vacías en Markdown; false usa texto lineal.
offsetNoDesplazamiento para continuar un fragmento PDF truncado
page_sizeNoCantidad máxima de caracteres por fragmento (por defecto 8000; máximo 20000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.1.1
    • changedInput schema / properties / format / description
      Previous value: -"Salida extra?da: markdown conserva tablas; text y raw devuelven texto plano, no bytes binarios."New value: +"Salida extraída: markdown conserva tablas; text y raw devuelven texto plano, no bytes binarios."
    • addedInput schema / properties / full
      Added value: +{
      +  "description": "true devuelve el documento completo en una sola respuesta (hasta 150.000 caracteres) en vez de fragmentos de 8.000; si todavía se trunca, continuar con offset.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / layout
      Added value: +{
      +  "description": "PDF: true (por defecto) reconstruye las tablas con sus columnas y celdas vacías en Markdown; false usa texto lineal.",
      +  "type": "boolean"
      +}
  2. First observedv2.0.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations only say readOnly and openWorld; the description adds real behavioral context: OCR never downloads Tesseract models and is off by default, output is capped at 150,000 characters, truncation is continued via offset, and PDF tables are reconstructed with columns unless layout:false. These are exactly the side-effect and limit disclosures an agent needs before calling.

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?

Front-loads purpose in the first sentence and then layers defaults, limits and the folder fallback in a logical order with no filler. It is dense—four information-packed sentences—but each one carries distinct content.

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 an 8-parameter, read-only, open-world tool with no output schema, the description covers formats, pagination, OCR constraints, size caps and table handling well. What is missing is the shape of the returned text (e.g. whether page markers or file names are included) and any session/auth prerequisite for Campus Virtual URLs.

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% and every parameter is already documented there, including the 150k cap, the 8,000-character fragment size and the offset continuation. The description largely restates those defaults (full, layout, ocr) rather than adding syntax or edge-case semantics, so baseline 3 applies.

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?

States a concrete verb+resource ('Descarga y extrae texto/tablas') and enumerates the supported formats, which makes the extraction intent unmistakable. However, it never contrasts itself with close siblings like download_file, read_external or get_pdf_page_image, so an agent must infer which one to pick.

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?

Gives one explicit routing rule ('Si la URL es una carpeta, usá open') and useful context for the full/offset workflow and the OCR default. It stops short of stating when NOT to use it, e.g. when the raw binary is wanted (download_file) or a page image is wanted (get_pdf_page_image).

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