Skip to main content
Glama

github_get_file

Read a file's contents from a GitHub repository by owner, repo, and optional path/ref for read-only inspection; binary files return a notice.

Instructions

读取仓库中一个文件的内容(只读,二进制会提示)。

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": "github_get_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo分支/标签/SHA,默认分支
pathNo仓库内文件路径
repoYes仓库名
ownerYes仓库所有者(用户或组织)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the burden. It does add genuine behavior beyond the name: the operation is read-only, and binary files are signalled rather than dumped. However, it says nothing about truncation or size limits on large files, encoding of returned content, behavior on a missing path or bad ref, or authentication requirements.

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 short sentence with the scope and the read-only/binary caveat front-loaded; nothing is wasted. It is arguably terse to the point of under-specification, but there is no filler.

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 four-parameter read tool with no annotations and no output schema, the description covers the core action and one edge case, but leaves the return shape (raw text versus metadata, how binary is reported) and failure modes unexplained, which matters more here since no output schema exists.

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 owner, repo, path, and ref are already documented in the schema. The description adds no additional meaning about how path is resolved relative to ref or what happens when either is omitted, so baseline 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?

States a specific verb and resource: read a file's contents from a repository. It is distinguishable from listing or search siblings by the singular file scope, though it does not name github_get_readme or github_list_directory to clarify the boundary between fetching a known path versus discovering one.

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 only implied (fetch a file you already have a path for); the definition gives no explicit when-to-use or when-not guidance, no mention of alternatives such as directory listing or the README helper, and no prerequisite about needing a valid path within the default or given ref.

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