Skip to main content
Glama

Upstream.codes

Read file or folder

get_file_contents
Read-only

Read a file's text, or list a folder (the repository root when path is empty), at a branch, tag or commit (default branch when ref is left out). Use startLine/endLine to read part of a long file.

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

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag or commit SHA.
pathNoFile or folder path, without a leading slash.
repoYesRepository slug.
ownerYesNamespace that owns the repository (user or organization handle).
endLineNo
startLineNo

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered. The description adds real behavioral context beyond that: the empty path implies listing the repository root, and an omitted ref implies the default branch. It omits truncation, file-size, and binary-file behavior, but the added defaults are substantive.

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 compact sentences, with the dual behavior front-loaded before the line-range hint. Every clause carries information; there is no filler or restatement of the title.

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 dual-mode tool with no output schema, the description never indicates what a folder listing returns (entries, names, metadata) versus a file read, nor what happens with large or binary files. Enough is present to invoke it correctly, but not enough to predict the response shape.

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 coverage is 67%, and the description fills the main gaps: path="" means repository root, missing ref means default branch, and startLine/endLine select a slice of a long file. It does not clarify whether the line range is inclusive or whether both bounds must be supplied together, but the key semantics are added.

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 precise verb and resource ("Read a file's text, or list a folder") and covers the two operating modes in one clause. It does not explicitly distinguish itself from siblings like search_code or github_read, so an agent must infer the boundary rather than being routed.

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 implied by the mode description: direct path read versus folder listing, plus the hint to use startLine/endLine for long files. There is no explicit when-not guidance or named alternative (e.g. when to prefer search_code instead of listing and scanning), leaving conditional choices to inference.

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