Skip to main content
Glama

Read file

read_file
Read-only

Reads a text file with line numbers. Use offset/limit (1-based lines) for long files. The last line gives the file's version: pass it as base to write_file or edit_file so a write is refused if someone changed the file after your read.

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

Input Schema

NameRequiredDescriptionDefault
pathYesPath relative to the project root, e.g. src/routes/home.tsx
limitNo
offsetNo
projectIdYesProject id from list_projects

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish this is a non-destructive, closed-world read, so the bar is lower, and the description still adds real context: output is line-numbered and terminated by a version token used for write-time conflict detection. It omits error behavior and encoding/binary handling, so it is strong but not exhaustive.

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?

Three short sentences: what it returns, how to page, and the concurrency contract. The most decision-relevant fact (line numbers, version token) is front-loaded and nothing is redundant with the annotations.

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 no output schema, the description usefully sketches the response (line numbers plus a trailing version line) and the cross-tool workflow with write_file/edit_file. Gaps around failure modes and file-size limits are minor for a read tool whose safety profile is already annotated.

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

Parameters4/5

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

Schema coverage is only 50%, with offset and limit undocumented in the schema, and the description compensates by explaining they are 1-based line paging controls for long files. It does not state default limit or the 2000 cap in prose, leaving some semantics to the schema bounds.

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?

"Reads a text file with line numbers" gives a specific verb plus resource and immediately states the output shape. It also names write_file/edit_file as the counterpart operations, so an agent can place it relative to sibling file tools without opening schemas.

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 concrete usage rules: use offset/limit for long files and pass the returned version as base to write_file/edit_file to get optimistic-concurrency protection. It does not say how to discover a path (e.g., list_files/search_files) or what happens for a missing or binary file, so it falls short of full when/when-not coverage.

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