Skip to main content
Glama

github_get_file

Read-only

Read one file from a GitHub repository (any branch, tag or commit). Passing a directory lists it.

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag or commit SHA (optional; default branch if omitted)
pathYesFile path in the repo, e.g. src/index.js
repoYesRepository as owner/name, e.g. "octocat/hello-world" (a github.com URL works too)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true, so the safety profile is known. The description adds the non-obvious trait that a directory path returns a listing rather than an error. It says nothing about large-file truncation, binary content, or encoding, which matter for a raw file read.

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?

Two tight sentences with zero filler; the core action is front-loaded and the edge case (directory path) follows immediately after.

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

Completeness3/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 carries the burden of explaining what comes back, yet it never describes the return shape (raw content vs base64 blob, metadata fields) or handling of large/binary files. Adequate for selecting the tool, thin for predicting the response.

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 100% and all three parameters carry descriptions, so the baseline is 3. The description's phrase "any branch, tag or commit" simply restates the ref parameter's own text and adds no extra syntax or defaulting detail.

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 file from a GitHub repository") and adds the scope of refs supported. The second sentence clarifies directory behavior, which separates it from a plain file reader, though it never names the sibling it displaces (e.g. github_list_tree).

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?

Usage is implied by "Read one file" and "Passing a directory lists it," but there is no explicit routing guidance such as "use github_list_tree to browse a repo first" or when to prefer github_search for locating a path. An agent must infer the boundary with siblings.

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