Skip to main content
Glama

Read a source file at an exact commit or package version

code_read
Read-only

Reads one file of a public GitHub repository or npm package straight from the origin, at an exact identity: a branch or tag is resolved to its commit sha first, and an npm tarball must match the registry's sha512. Returns the requested lines with the commit (or version and integrity), the path, the git blob id of the whole file and a source URL, so the lines can be re-read and checked. Pages by line: give start_line/end_line; next_start_line names the next page. A file that is not UTF-8 text (a NUL byte in its first 8000 bytes, or invalid UTF-8) is never shown as text: the answer is binary:true with its reason, size and blob id. Read-only; nothing is indexed or stored. Every answer, an error included, carries a pauhu-library-receipt/2 in structuredContent.receipt and as a trailing "receipt: {...}" text line; library_verify checks a receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag or 40-hex commit sha (default HEAD). It is resolved to a commit sha first; the read is at that sha.
pathYesFile path inside the repository or package, e.g. lib/index.js
repoNoGitHub repository as owner/name, e.g. nodejs/node. Give this or package.
packageNonpm package name, e.g. source-map-js or @scope/name. Give this or repo.
versionNonpm version or dist-tag (default latest); the tarball is checked against the registry's sha512 integrity.
end_lineNoLast line, inclusive (default start_line + 1999)
start_lineNoFirst line, 1-based (default 1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations: it discloses that refs are resolved to a commit sha, that npm tarballs are checked against the registry sha512, the exact binary-detection rule (NUL byte in first 8000 bytes or invalid UTF-8), the binary:true answer shape, and that every response carries a pauhu-library-receipt/2. Nothing here is duplicated from the annotations.

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 action and the identity guarantee, and each subsequent sentence covers a distinct behavior (paging, binary handling, receipts). It is dense but slightly long; the receipt sentence is necessary but the most expendable.

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

Completeness5/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 still describes the return payload (requested lines, commit/version and integrity, path, blob id, source URL) and the error case (receipt on every answer, binary:true with reason/size/blob id). An agent has everything needed to call and interpret it.

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 description coverage is already 100%, so the baseline is 3; the description adds how ref resolution and npm integrity verification actually behave and clarifies that next_start_line drives the next page. It stops short of giving format examples beyond what the schema already supplies.

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?

States a specific verb and resource ('Reads one file of a public GitHub repository or npm package') with the exact identity constraint that distinguishes it from code_list, code_grep and source_fetch_fragment. An agent can tell this is the single-file, commit-pinned read tool without opening the schema.

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?

Explains when the tool applies (need one file at an exact commit/version), how to page (start_line/end_line, next_start_line), and routes receipt-checking to the library_verify sibling. It does not explicitly contrast itself against code_grep or source_fetch_fragment, so no exclusions are stated.

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