Skip to main content
Glama

read_file

Read a local text file, optionally limited to a specific line range, to inspect file contents before editing or analyzing code and logs.

Instructions

Read a local text file with optional line range.

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

Input Schema

NameRequiredDescriptionDefault
endLineNo
filePathYesAbsolute file path
startLineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, and it discloses almost nothing: no mention of default truncation (the schema's 1-250 default means an unbounded-looking call silently returns only 250 lines), no encoding assumptions, no missing-file or permission error behavior, and no note on read limits for large files.

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?

A single tight sentence with the resource first and the optional modifier second, so nothing is padded. It is efficient but leaves no room for the operational caveats this tool needs.

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

Completeness2/5

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

For a file-reading tool with no annotations and no output schema, the description should cover return shape, truncation, and failure modes. It covers none of these, leaving an agent unable to predict that a call without line arguments returns only a bounded window of the file.

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 33% (filePath is documented as an absolute path; startLine and endLine are not). The phrase "optional line range" does convey the joint semantics of the two line parameters, which partially compensates, but it never clarifies whether the range is inclusive or how out-of-bounds values behave.

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?

"Read a local text file with optional line range" gives a specific verb (read) and resource (local text file), plus a scope qualifier. It implicitly separates the tool from write_file/edit_file siblings, though it never names an alternative.

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

Usage Guidelines2/5

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

No guidance on when to use this versus batch_read, find_files, or code_outline. The only hint is "local text file," which is a resource constraint rather than a when-to-use rule, and there is no mention of exclusions such as binary or non-text files.

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