Skip to main content
Glama

get_file

Read-only

Read a file's UTF-8 text or list a directory from a GitHub repository at any branch, tag, or commit. Provide repo, path, and optional ref.

Instructions

Read a file's content (UTF-8 text) or list a directory from a repository at a given branch, tag, or commit. Pass path '' or '/' for the repository root.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA (default: default branch)
pathYesFile or directory path within the repo ('' for root)
repoYesRepository name (without owner)
ownerNoRepo owner; defaults to GITHUB_DEFAULT_OWNER
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint. The description adds valuable context about UTF-8 text encoding, root path handling, and ref types, enriching the behavioral model without contradicting annotations.

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, front-loaded with the core purpose and a key usage detail. No wasted words; every element serves to clarify the tool's function.

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?

No output schema exists, so description should clarify return format. It implies file content for files but leaves directory listing format unspecified. However, the tool is simple and the core usage is well explained, making it adequate for typical agent invocation.

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 covers all 4 parameters with descriptions, giving baseline 3. The description supplements by explaining the special root path convention ('') and the meaning of ref (branch/tag/commit), adding meaningful clarity beyond 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?

The description clearly states the tool reads file content or lists directories, with specific reference to branch/tag/commit. This distinguishes it from sibling tools like get_pr or list_branches, which serve different purposes.

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?

The usage context is clear: it reads repository files/directories at a given ref. However, it does not explicitly name alternatives or state when not to use it, though no sibling tool duplicates this functionality.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iiinigence/github-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server