Skip to main content
Glama
google-seo-mcp
by Akxan

Read a file from GitHub

github_get_file
Read-onlyIdempotent

Read a text file from a GitHub repository branch, returning content, SHA, size, and URL; search within it using find or page through large files with offset when truncated.

Instructions

Read a text file from a repository branch. Returns content, sha, size and the file's URL. Files of any size are readable (the blob API is used past GitHub's 1 MB contents limit), but only maxBytes are returned per call: page through a large content bundle with the nextOffset of a truncated reply, or change it in place with github_commit_files edits instead of reading it whole. With find it greps the whole file instead and returns only matching lines, which also works where github_search_code finds nothing. Binary files are refused.

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_get_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag or commit; defaults to the default branch.
findNoSearch the whole file for this text; returns matches (line, byteOffset usable as offset, excerpt) instead of content.
pathYesPath inside the repository, e.g. 'src/pages/index.astro'.
repoYesRepository as 'owner/name', e.g. 'octocat/my-site'.
regexNofind is a JavaScript regex (^ and $ match per line).
offsetNoByte offset to start at (use the nextOffset of a truncated reply). Never splits a UTF-8 character.
contextNoLines shown around each match.
maxBytesNoMost bytes of file content to return in one call, so a huge file cannot flood the answer. Above ~100 KB the server's own result cap may trim the reply further.
ignoreCaseNo
maxMatchesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.14.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / context
      Added value: +{
      +  "default": 2,
      +  "description": "Lines shown around each match.",
      +  "maximum": 10,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / find
      Added value: +{
      +  "description": "Search the whole file for this text; returns matches (line, byteOffset usable as offset, excerpt) instead of content.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / ignoreCase
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / maxMatches
      Added value: +{
      +  "default": 20,
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • removedInput schema / properties / offset / maximum
      Removed value: -9007199254740991
    • addedInput schema / properties / regex
      Added value: +{
      +  "default": false,
      +  "description": "find is a JavaScript regex (^ and $ match per line).",
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changedv0.10.0
    • addedInput schema / properties / maxBytes
      Added value: +{
      +  "default": 100000,
      +  "description": "Most bytes of file content to return in one call, so a huge file cannot flood the answer. Above ~100 KB the server's own result cap may trim the reply further.",
      +  "maximum": 300000,
      +  "minimum": 1000,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Byte offset to start at (use the nextOffset of a truncated reply). Never splits a UTF-8 character.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / path / description
      Added value: +"Path inside the repository, e.g. 'src/pages/index.astro'."
  3. Changed1 schema field changedv0.5.1
    • removedInput schema / additionalProperties
      Removed value: -false
  4. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, open-world safety, and the description adds real behavior beyond them: the blob API fallback past the 1 MB contents limit, the maxBytes truncation with nextOffset paging, and the refusal of binary files. It also discloses that find mode swaps the return shape entirely (matching lines, not content), which is exactly the kind of mode-dependent behavior an agent cannot infer.

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 purpose and return values, then mode behavior and limits. Every sentence carries information, though the parenthetical about the blob API and the compressed pagination clause are dense enough that a reader may need a second pass; a short break between the read, paging, find, and binary clauses would help.

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?

With 10 parameters, no output schema, and two distinct modes, the description compensates well by enumerating return fields, truncation behavior, and the find-mode return shape. Minor gaps remain, such as what a truncated reply looks like structurally and how error cases beyond binary files surface, but nothing essential to invoking it correctly is missing.

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 80%, so the baseline is 3, and the description pushes past it by explaining the two operating modes of the parameters rather than restating them: find turns the call into a whole-file grep returning line/byteOffset/excerpt, and offset is tied to the nextOffset of a truncated reply. It does not add meaning for ref, regex, context, ignoreCase or maxMatches, leaving those to the schema.

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 ('Read a text file from a repository branch') and immediately names the returned fields (content, sha, size, URL). It also scopes the tool against siblings by naming github_commit_files and github_search_code in the following sentences, so an agent knows this is the read path, not the search or write path.

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?

Gives explicit routing rules: use github_commit_files edits instead of reading a file whole when changing it in place, and use find mode where github_search_code finds nothing. It also tells the agent to page with nextOffset for large content bundles, which is a concrete when-to-use condition rather than a hint.

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