Skip to main content
Glama

GitPicker

read_file

读取 GitHub 仓库中一个文本文件的内容(源码、配置、Markdown 等)。path 为仓库内完整路径。branch 缺省时自动使用默认分支。大文件建议传 start_line/end_line 分段读取(返回带 L行号 前缀,便于引用);不传则全量返回(上限 40k 字符)。二进制/超大文件会返回说明。

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

Input Schema

NameRequiredDescriptionDefault
pathYes文件完整路径,如 package.json 或 src/index.ts
repoYes仓库名
ownerYes仓库属主
branchNo分支名,缺省用默认分支
end_lineNo结束行(含),缺省读到文件末尾
start_lineNo起始行(1-based,含),配合 end_line 分段读取大文件

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the 40k character output cap, the L-prefixed line-number return format, default-branch fallback, and that binary/oversized files yield an explanatory message rather than content. It omits auth requirements, not-found/error behavior, and encoding handling.

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?

Front-loads the purpose, then layers in defaults, segmentation advice, return format, and size limits in four compact clauses with no filler or repetition.

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?

For a 6-parameter read tool with no annotations and no output schema, the description covers the return format, truncation limit, and edge cases well. Missing are failure modes (file not found, permission denied) that an agent would benefit from knowing before calling.

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%, so every parameter is already documented, including branch defaulting and the start_line/end_line pairing. The description largely restates that and only adds the 40k read ceiling, so baseline 3 is appropriate.

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+resource: reading the content of a text file in a GitHub repo, and enumerates file kinds (source, config, Markdown). It implicitly contrasts with listing tools by emphasizing content reading, but never names list_files, so sibling differentiation is only inferable.

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?

Gives real usage context: pass start_line/end_line for large files, omit for full read. However there is no guidance on when to use this versus list_files (discovery), nor on what to do when the file is binary or exceeds the 40k cap beyond 'returns an explanation'.

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