Skip to main content
Glama
mcp-server-repo-context

mcp-server-repo-context

read_file

Read a single text file from a repository using its repo-relative path, with optional start and end line limits to retrieve only the needed code context.

Instructions

Read one text file by repo-relative path, optionally a 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": {
      "path": "<path>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
end_lineNo
start_lineNo

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 at all, the description carries the full behavioral burden, yet says nothing about read-only safety profile, encoding, binary-file handling, path-outside-repo errors, or whether large files are truncated. The only behavioral fact conveyed is that line-range selection is optional.

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 front-loaded sentence with zero filler; the verb, resource, path convention, and optional range appear in reading order. It is efficient, though so terse that the trimming shades into under-specification addressed in other dimensions.

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, no output schema, and 0% parameter coverage, the description should explain range semantics, encoding, and failure modes. None of that is present, so an agent must guess at slicing behavior and error conditions before calling.

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 0%, so the description must compensate and it partly does: 'repo-relative path' clarifies that absolute paths are not expected, and 'optionally a line range' explains that start_line/end_line work as a pair. It leaves critical details unstated — 1-based indexing, inclusive bounds, and what happens if only one bound is supplied.

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 one text file') plus the key scoping detail 'repo-relative path', which separates it from repo-level siblings like pack_repo or repo_tree. It stops short of explicitly naming an alternative such as search_code, so it is clear but not sibling-differentiated at the top level.

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?

'optionally a line range' implies you may read a slice rather than a whole file, which is a faint usage hint. There is no statement of when to prefer this over search_code, estimate_tokens, or repo_tree, and no exclusions (binary files, paths outside the repo) are given.

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