Skip to main content
Glama
mcp-server-github

mcp-server-github

by DebuggingMax

get_file_contents

Retrieve a file's contents from a GitHub repository using owner, repo, and path, with an optional branch, tag, or commit ref to read the exact version.

Instructions

Get contents of a file from a repository

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>",
      "path": "<path>"
    },
    "name": "get_file_contents"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA
pathYesFile path
repoYesRepository name
ownerYesRepository owner

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden and falls well short. It does not say whether content is returned raw or encoded (GitHub-style APIs typically return base64), whether large files are truncated, or whether directories return listings rather than file content — all of which materially affect how the agent interprets the result.

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?

A single, front-loaded sentence with zero filler, which is appropriate in form. The brevity is only a problem because of what it omits, not because of wasted wording.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description should explain the return shape (raw vs encoded content, directory behavior) and any limits. None of this is present, leaving the agent unable to predict what it will receive from a 4-parameter file-read operation.

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%, with each of the four parameters (owner, repo, path, ref) documented in the schema itself. The description adds no additional meaning beyond the schema, so the baseline of 3 applies.

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?

The description states a specific verb and resource ('Get contents of a file from a repository'), so the agent knows exactly what the tool returns. It does not, however, distinguish this tool from siblings such as create_or_update_file or search_code, which an agent may confuse when it actually wants to search or modify content.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites (e.g., authentication or that a repo must exist), and no pointer to alternatives like search_code for locating a file. The agent must infer usage entirely from the name and schema.

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