Skip to main content
Glama

read_file

Reads the contents of text files from local, Remote-SSH, WSL, or container paths, with optional line ranges and byte offsets for bounded access.

Instructions

Read the contents of a text file (supports both Local paths and Remote-SSH/WSL/Container paths in VS Code). Each read returns at most 800 lines or 46080 bytes.

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
PathYesThe absolute path of the file to read.
EndLineNoEnd line to read (1-indexed, inclusive). Omit to read up to 800 lines.
StartLineNoStart line to read (1-indexed, inclusive). Omit to read from the beginning.
ByteOffsetNoByte offset into the line range when truncated by the byte limit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It usefully discloses the hard caps (800 lines / 46080 bytes) and the multi-environment path support, but says nothing about what happens on a missing file, whether reads are strictly read-only and side-effect free, or how truncation is signalled in the response.

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?

Two sentences, zero waste, with the resource and path-support scope front-loaded ahead of the size limits. Nothing here is redundant or padding.

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 a four-parameter read tool with a fully documented schema and no output schema, this covers the essentials: what it reads, where it can read from, and how much it returns. The main residual gap is not describing what the returned payload looks like when truncated.

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 Path, StartLine, EndLine, and ByteOffset are all self-documented. The description reinforces the 800-line cap tied to EndLine but adds no semantics beyond the schema, which is the expected baseline when the schema does the heavy lifting.

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 specific verb and resource ("Read the contents of a text file") and adds the useful scope detail that Local, Remote-SSH, WSL, and Container paths are all supported. It does not, however, distinguish itself from siblings like vscode_open_file, so an agent must infer that this returns content rather than opening an editor.

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

Usage Guidelines3/5

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

Usage is only implied: read a file when you need its contents. There is no explicit when-to-use versus when-not guidance, no pointer to grep_search or find_by_name for locating content, and no note that vscode_open_file is the alternative for showing a file to the user.

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