Skip to main content
Glama

read_file

Read-only

Read a file. Text: offset is the zero-based first line and length the line count (default 1000); a negative offset reads the last N lines. Returns a "[Reading N lines from … (total: T lines, R remaining)]" header, then the text. Also reads images (as images), PDF (offset/length count pages; options.ocr auto|force|off, Korean/English OCR), DOCX (outline; docxMode text|outline|xml) and spreadsheets (sheet, range: 2D values). For several files use read_multiple_files (up to 20 in one call). For web pages use read_url.

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
isUrlNo
rangeNo
sheetNo
lengthNo
offsetNo
optionsNo
deviceIdNoComputer name or id
docxModeNo
docxPartNo
maxBytesNo
maxImagesNo
extractImagesNo
workSessionIdNoFrom create_work_session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id; optional with one computer or a default"New value: +"Computer name or id"
    • removedInput schema / properties / docxPart / maxLength
      Removed value: -128
    • removedInput schema / properties / range / maxLength
      Removed value: -128
    • removedInput schema / properties / sheet / maxLength
      Removed value: -31
    • removedInput schema / properties / sheet / minLength
      Removed value: -1
  2. Changed2 schema fields changed
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id from list_devices. Optional with one computer online or a default set."New value: +"Computer name or id; optional with one computer or a default"
    • changedInput schema / properties / workSessionId / description
      Previous value: -"Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work."New value: +"From create_work_session"
  3. Changed1 schema field changed
    • addedInput schema / properties / workSessionId
      Added value: +{
      +  "description": "Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work.",
      +  "format": "uuid",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true, so the safety profile is covered. The description adds genuinely useful output-shape detail (the "[Reading N lines from … (total: T lines, R remaining)]" header) and the negative-offset tail-read behavior. However it says nothing about size limits, truncation, or failures even though a maxBytes parameter exists, so behavioral disclosure is only partial.

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?

Dense but front-loaded: core read semantics come first, then format-specific notes, then sibling routing. Nearly every clause earns its place, though the PDF/DOCX/spreadsheet list is packed tightly enough that some option details are hard to parse on first read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter tool with no output schema, the description covers the common text path well and even describes the return header, which partially substitutes for an output schema. It falls short on the long tail of parameters (maxBytes, maxImages, extractImages, deviceId, workSessionId) that an agent would otherwise have to guess at.

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 only 14% across 14 parameters, so the description must carry real weight; it does explain offset, length, options.ocr, docxMode, and sheet/range at a high level. But isUrl, deviceId, docxPart, maxBytes, maxImages, extractImages, and workSessionId are undocumented in both places, and range syntax is never specified.

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?

Opens with a specific verb+resource ("Read a file") and then enumerates exactly which file types are supported and what offset/length mean for each. It explicitly names the two siblings that cover adjacent cases (read_multiple_files, read_url), so an agent can distinguish it from alternatives without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit routing rules: "For several files use read_multiple_files (up to 20 in one call). For web pages use read_url." It also states per-format applicability (images, PDF with OCR options, DOCX outline modes, spreadsheets with sheet/range), which is the when-to-use guidance an agent needs.

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.

Resources