Skip to main content
Glama

GitHub read file

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.).

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": {
      "repo": "<repo>",
      "path": "<path>"
    },
    "name": "github_read_file"
  }
}

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.9/5.0
Behavior5/5

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

Beyond the 'readOnlyHint' annotation, the description provides critical behavioral constraints, specifically stating that the tool 'Refuses to read known sensitive files (.env, private keys, etc.)'. This is vital safety information for the AI agent's decision-making.

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?

The definition is well-structured, moving from core function to sibling differentiation, parameter guidance, and finally use cases and limitations. It avoids fluff and is highly dense with actionable information.

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?

Given the tool's complexity (6 parameters, paging capabilities), the description provides complete context regarding parameter usage, functional scope, and inherent limitations (sensitive file refusal). This is all that is needed since the schema is exhaustive.

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?

With 100% schema coverage, the baseline is high. The description adds significant semantic value by explaining the hierarchical preference for owner selection and detailing the practical use cases for the tool, such as inspecting configuration files and source code.

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?

The description clearly defines the tool's function: reading the content of a single file from a repository. It distinguishes itself from the listing function by explicitly directing users to call 'github_list_repository_files' for directory contents, ensuring no functional ambiguity between similar siblings.

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?

It provides multiple clear usage guidelines. It dictates using this tool for specific content inspection (like Dockerfiles or CI configs) and instructs users on parameter preference (preferring the exact owner over the combined 'owner/name' format).

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.