Skip to main content
Glama

get_file_contents

Retrieve the raw text contents of a file from a GitHub repository. Provide owner/repo, path, and optional ref; large files are refused to protect the context.

Instructions

Get the raw text contents of a file in a repository.

Files larger than 100,000 characters are refused to protect the context window; fetch a narrower path instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA (defaults to the default branch).
pathYesFile path within the repository, e.g. "src/server.py".
repoYesRepository as "owner/repo".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the transparency burden. It discloses a significant behavioral trait: files larger than 100,000 characters are refused to protect the context window. This is valuable beyond basic operation, although it does not mention error handling or authentication, which are less critical for this simple fetch.

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?

The description is only two sentences long, front-loads the core purpose, and adds one critical behavioral note. Every sentence earns its place with no redundancy or fluff.

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?

Given the tool's simple function, the description is nearly complete: it states what is fetched, highlights a key constraint, and suggests a workaround. An output schema exists, so return-value details are not needed. Minor gaps like binary-file handling are not critical for this low-complexity tool.

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 the baseline is 3. The description itself adds little parameter-specific meaning beyond the schema, though 'fetch a narrower path' hints at how to use the path parameter to avoid size limits. The schema already documents each parameter adequately.

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 begins with a specific verb 'Get' and resource 'raw text contents of a file in a repository,' clearly distinguishing this from sibling tools that handle issues, PRs, or repository metadata. It unambiguously states what the tool does.

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 description provides clear context for when this tool is appropriate—fetching file contents. It does not explicitly name alternative tools, but the size-limit advice ('fetch a narrower path instead') implies a usage adjustment. With no sibling tool performing the same function, the context is sufficient.

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/awernick/github-mcp'

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