Skip to main content
Glama
gh-search-mcp
by raystyle

get_file_contents

Read-onlyIdempotent

Read a text file, list a directory, or view a repository tree in a public GitHub repository. Use it after searching to open and inspect the result.

Instructions

Read a text file, list a directory, or show a repository's tree, in a public GitHub repository. Use it after a search to open what you found.

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": {
      "owner": "<owner>",
      "repo": "<repo>"
    },
    "name": "get_file_contents"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag or commit SHA. Defaults to the default branch.
pathNoFile or directory path. Empty lists the repository root.
repoYesRepository name.
ownerYesRepository owner: a user or organization name.
end_lineNoLast line to return, inclusive. At most 400 lines are returned per call. Ignored for directories.
recursiveNoFor a directory: show its whole subtree instead of a single level.
start_lineNoFirst line to return (1-based). Ignored for directories.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so safety is covered. The description still earns credit for the non-obvious access constraint that only public repositories are readable, a scoping detail the annotations do not convey. It does not discuss rate limits or binary/large-file behavior, which keeps it below 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?

Two sentences, zero filler, with the capability set front-loaded and the usage cue second. Nothing redundant with the schema is repeated.

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?

For a 7-parameter read tool with no output schema, the description does not indicate the shape of the result — whether file content comes back raw, how a directory listing is formatted, or how truncation is signaled to the caller. Annotations and the rich schema cover safety and inputs, so this is adequate but leaves a real gap on the return side.

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 ref, path, recursive, and the line-range parameters are already fully documented in the schema, including the 400-line cap and directory-ignored semantics. The description adds no format or syntax guidance beyond that, which is the expected baseline when the schema does the work.

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 three concrete modes (read a text file, list a directory, show the repository tree) against a named resource (a public GitHub repository), so the agent knows exactly what will come back. The second sentence positions it relative to the search siblings, making the split between 'find' and 'open' unambiguous.

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?

"Use it after a search to open what you found" gives clear sequencing guidance and implicitly routes discovery to search_code/search_repositories. It stops short of explicit exclusions (e.g., private repos, or when to prefer the tree mode over listing), so it is clear context without full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools