Skip to main content
Glama
a2br
by a2br

read_file

Read-only

Downloads a Moodle file and returns its text. For long PDFs, get a page map and request specific pages by number.

Instructions

Download a Moodle file (e.g. an assignment attachment or a file in a folder) and return its text.

Long PDFs return a page map first; call again with pages="12-14" for the pages you need.
Code and text files come back as-is. On the user's Mac the file is also saved locally (path in the output).

Args:
    file_url: A moodle.epfl.ch .../pluginfile.php/... URL from open_item, search_in_files or read_discussion.
    pages: For PDFs, which pages to read, e.g. "1-5", "2,4,10-12" or "all".
    max_chars: Maximum characters of text to return; longer PDFs get a page map.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagesNo
file_urlYes
max_charsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnlyHint=true annotation, the description discloses concrete behavior: PDFs get a page map for long files, code/text files return as-is, files are saved locally on the user's Mac with the path in output, and max_chars triggers page-map behavior. This is substantial behavioral transparency, exceeding what annotations provide.

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?

The description is front-loaded with the core action, then gives behaviorally important PDF handling, then parameter details. Every sentence provides useful information; there is no filler or repetition of schema structure.

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?

Given an output schema is present, return values need not be explained. The description covers all three parameters, behavior for different file types, pagination flow, local saving, and URL provenance. An agent has everything needed to call the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the Args section carries the full burden. It explains file_url's expected URL shape, pages formats ('1-5', '2,4,10-12' or 'all'), and max_chars semantics. This compensates completely for the schema's lack of descriptions.

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?

The description opens with a specific verb and resource: 'Download a Moodle file... and return its text.' It clarifies the kinds of files (assignment attachments, folder files) and sources for the URL, which distinguishes it from sibling tools like read_discussion or search_in_files.

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 clear operational guidance: long PDFs return a page map first, then instructs to call again with pages='12-14'. It also specifies where file_url comes from (open_item, search_in_files, read_discussion), providing workflow context. It doesn't explicitly state exclusions or when not to use this tool, but that is not a major gap given the clear file-reading purpose.

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