Skip to main content
Glama

merjax_read_file

Read-only

Read a file from a repo at a given ref. Mirrors GET /api/v2/repos/:owner/:repo/contents/:path. Returns {path, size, content, encoding, totalLines}. Pass start_line / end_line (1-based, inclusive) to read only part of a text file. A text file over ~60 KB read with no range returns its first ~60 KB of whole lines with truncated: true, startLine/endLine and a hint — ask for the next range to read on.

Input Schema

NameRequiredDescriptionDefault
refNoBranch / tag / sha (default HEAD)
pathYes
repoYes
ownerYes
encodingNo'utf8' (default) or 'base64'
end_lineNoLast line to return (1-based, inclusive; clamped to the file's length). Text files only.
start_lineNoFirst line to return (1-based, inclusive). Text files only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare this a safe read, and the description goes further by disclosing the return shape, the ~60 KB truncation threshold with truncated/startLine/endLine/hint fields, and the follow-up pattern of requesting the next range. It stops short of covering binary/base64 handling or error behavior (missing path, bad ref), which matters given there is no output schema.

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?

Front-loaded with the core operation, then the return shape, then the range and truncation rules — a sensible order with no filler. The final sentence is long and packs truncation semantics densely, but every clause carries actionable information.

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 7-parameter read tool with no output schema, the description does the heavy lifting on return values and large-file behavior, which is exactly where an agent would otherwise guess. The remaining gaps — ref defaults, base64 encoding semantics, and failure modes — are real but secondary for a read-only tool.

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 57%, and the description mostly restates what the schema already says about start_line/end_line (1-based, inclusive, text files only). It adds the useful interaction detail that the range applies to text files and that out-of-range requests are clamped/truncated, but owner, repo, ref, and encoding receive no added meaning in the description.

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 a file from a repo at a given ref") and even maps it to the underlying REST endpoint, so the operation is unambiguous. However, it never distinguishes itself from the near-identical sibling merjax_repo_read_file, nor from merjax_list_tree or merjax_search_code, leaving an agent unable to choose between them from the description alone.

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?

Guidance is present but narrow: it explains when to pass start_line/end_line and what to do after a truncated response. There is no statement of when this tool is preferred over the closely-named sibling readers or over search/tree tools, and no mention of prerequisites such as auth scope or repo access.

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