Skip to main content
Glama

Get repository file

get_file
Read-onlyIdempotent

Fetch a single file from a GitLab repository at a specified ref. Decodes base64 text by default; supports line ranges for partial content.

Instructions

Fetch one repository file at a ref. Text is decoded from base64 by default; binary or unusually large content stays base64.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNo
pathYes
projectYesGitLab project ID or full path such as group/project.
end_lineNo
start_lineNo
decode_textNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesGitLab response normalized for model use.
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive. The description adds valuable behavioral context: text is decoded from base64 by default, while binary or unusually large content stays base64. This goes beyond annotations and clarifies response format, which is critical for consumption.

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 primary verb and resource. Every word contributes value; no filler. The first sentence states the core action, the second adds a key behavioral nuance about encoding. This is a model of conciseness.

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?

Tool has a moderate parameter count (6) with an output schema, so return format need not be described. The description covers the main action, ref scoping, and decoding behavior. Missing details like line-range parameters are relatively niche. Given annotations and output schema, the description is sufficiently complete for most use cases, though it could note that line parameters exist.

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 only 17% (only 'project' has a description). The description explains the semantics of 'ref' ('at a ref') and 'decode_text' ('decoded from base64 by default; binary or unusually large content stays base64'), adding meaning not in the schema. However, it does not clarify 'start_line' or 'end_line', which likely control line ranges. Given low coverage, more compensation is expected, but the added details are useful.

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?

Description clearly states 'Fetch one repository file at a ref' – a specific verb and resource. It also distinguishes from sibling tools by specifying 'one' file (vs. lists) and referencing 'ref' for version-specific retrieval. The context about base64 decoding further clarifies behavior.

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?

Description implies usage for retrieving a single file at a specific ref, but does not explicitly mention when to use it over alternatives like get_blob, search_code, or fetch_gitlab_file_url. No exclusions or alternative guidance provided beyond the basic purpose.

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/CobolJunkie/gitlab-mcp'

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