Skip to main content
Glama

read_file

Read-only

Retrieves course files, assignment submission details, and feedback from returned paths; supports ZIP/PDF page selection and paginated text output.

Instructions

读取 list_files/search_content 的课件路径或作业 read_path/附件 path;submission:活动ID 读提交详情和反馈。ZIP 用 inner(支持 PDF/Office),PDF 用 page_start/page_end,长内容用 offset/max_chars 分页。返回文本或文件清单。

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": {
      "path": "<path>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes文件搜索或作业列表返回的路径;submission:活动ID 可直接读提交详情
innerNoZIP 内路径;省略=列 ZIP 清单
offsetNo字符起点,默认0
page_endNoPDF 结束页,默认同起始页
max_charsNo最大字符数,默认20000,最高100000
page_startNoPDF 起始页,从1开始

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.15.0
    • addedInput schema / properties / page_end
      Added value: +{
      +  "description": "PDF 结束页,默认同起始页",
      +  "type": "integer"
      +}
    • addedInput schema / properties / page_start
      Added value: +{
      +  "description": "PDF 起始页,从1开始",
      +  "type": "integer"
      +}
    • changedInput schema / properties / path / description
      Previous value: -"list_files/search_content 返回的路径"New value: +"文件搜索或作业列表返回的路径;submission:活动ID 可直接读提交详情"
  2. Changed4 schema fields changedv0.1.3
    • addedInput schema / properties / inner / description
      Added value: +"ZIP 内路径;省略=列 ZIP 清单"
    • addedInput schema / properties / max_chars / description
      Added value: +"最大字符数,默认20000,最高100000"
    • addedInput schema / properties / offset / description
      Added value: +"字符起点,默认0"
    • addedInput schema / properties / path / description
      Added value: +"list_files/search_content 返回的路径"
  3. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

The readOnlyHint annotation already establishes the safety profile and the description is consistent with it, so the bar is lower. The description still adds useful behavior the annotations don't convey: ZIP paths return a file listing unless inner is supplied, PDFs are read by page range, and long content is paginated with a documented cap. Error behavior for a missing path is the only notable omission.

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?

It is a single dense paragraph with zero filler: source of the path first, then the submission shortcut, then the per-format handling rules, then the return shape. Every clause carries operational information and the ordering matches how an agent would reason about the call.

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 six parameters, full schema coverage and no output schema, the description supplies what the structured fields cannot: the input provenance, format-specific behavior, and the return shape (text vs file listing). It stops short of covering failure cases such as a nonexistent path or an invalid page range, which for a read tool of this complexity would have closed the gap.

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 every parameter is already documented; the description largely restates those semantics while adding the conditional framing (inner for ZIP, page_start/page_end for PDF, offset/max_chars for long content). That framing is modest added value over an already complete schema, so the baseline of 3 applies rather than a higher score.

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 starts with a specific verb+resource (读取…路径/文件) and immediately ties the tool to the sibling tools that produce its inputs (list_files/search_content) as well as the assignment read_path/attachment case and the submission:活动ID shortcut. An agent can tell this apart from list_files or search_content without opening either 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?

It gives concrete routing guidance: where the path value comes from, how to drill into a ZIP with inner, how to page a PDF with page_start/page_end, and how to chunk long text with offset/max_chars. It does not state when not to use this tool (e.g. when export_ed_lessons or read_ed_thread is the better fit), so it falls short of the full when/when-not/alternatives bar.

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