Skip to main content
Glama

github_read_file

Read-only

Read the content of ONE named file from a GitHub repository - 'path' is required and names that file. To see what a repository or directory CONTAINS, call github_list_repository_files instead (its 'path' is optional). Prefer the exact owner from github_list_repositories; 'repo' also accepts the combined 'owner/name' form. Use this to inspect Dockerfiles, package.json, CI configs, Helm charts, source code, and other text files. Refuses to read known sensitive files (.env, private keys, etc.).

Input Schema

NameRequiredDescriptionDefault
pathYesRequired. Path of the single file to read, within the repository (e.g. 'Dockerfile', 'src/index.ts', '.github/workflows/deploy.yml'). To list a directory rather than read a file, use github_list_repository_files.
repoYesRepository name. Also accepts the combined 'owner/name' form.
ownerNoRepository owner (e.g. 'octocat'). Prefer the exact owner from a prior github_list_repositories call. May be omitted when the repository name is unambiguous in this organisation, or embedded in 'repo' as 'owner/name'.
branchNoBranch name. Defaults to the repository's default branch.
max_linesNoMaximum number of lines to return, counted from start_line. Omit for no line cap.
start_lineNo1-based line to start from. With max_lines, pages through files too large to read in one call. Omit to read from the top.

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 declare readOnlyHint=true, so safety is largely covered. The description adds genuinely new behavior: it 'Refuses to read known sensitive files (.env, private keys, etc.)', a constraint not derivable from the schema or annotations. It does not cover rate limits or return format, so it stops short of a 5.

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?

Four tightly packed sentences covering purpose, sibling routing, owner preference, use cases, and the sensitive-file refusal, with the core verb and required-parameter fact front-loaded. No filler sentences.

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 6-parameter read-only tool with no output schema, the description covers purpose, alternatives, and the sensitive-file refusal. Pagination is only implicitly gestured at via the schema's start_line/max_lines, so an agent gets no prose guidance on reading large files, leaving a small gap.

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 description coverage is 100%, so every parameter (path, repo, owner, branch, start_line, max_lines) is already documented in the schema. The description restates that 'path' is required and that 'repo' accepts 'owner/name', which mostly duplicates schema text rather than adding new meaning, so baseline 3 is appropriate.

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 with scope: 'Read the content of ONE named file from a GitHub repository', and explicitly notes 'path' is required and names that file. It also distinguishes itself from the sibling github_list_repository_files, which governs repository/directory contents rather than a single file.

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

Usage Guidelines5/5

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

Explicitly routes the agent: 'To see what a repository or directory CONTAINS, call github_list_repository_files instead (its path is optional)'. It further advises preferring the exact owner from github_list_repositories and enumerates concrete use cases (Dockerfiles, package.json, CI configs, Helm charts, source code).

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