Skip to main content
Glama

gitlab_get_file

Read-onlyIdempotent

Retrieve text files from GitLab repositories to examine configuration files, source code, or documentation. Specify file path and branch/tag to access content directly.

Instructions

Read a text file from the repository, truncated to 500 lines.

For binaries, gets decoded as UTF-8 with errors replaced — you will likely get garbage; use for text content only.

Examples: - "Show me .gitlab-ci.yml on master" → file_path='.gitlab-ci.yml' - "Read src/app.py from the release-1.2 tag" → file_path='src/app.py', ref='release-1.2' - Don't use for listings — use gitlab_list_repository_tree.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the file from the repo root (e.g. 'src/app.py').
refNoBranch, tag or commit SHA.master
project_pathNoGitLab project path (e.g. 'my-org/my-repo'). When omitted, the default from GITLAB_PROJECT_PATH env var is used.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
refYes
sizeYes
total_linesYes
truncatedYes
contentYes
Behavior4/5

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

The description adds valuable behavioral context beyond what annotations provide: it discloses the 500-line truncation limit, explains how binaries are handled (UTF-8 decoding with error replacement), and warns about potential garbage output. While annotations cover read-only, non-destructive, idempotent, and open-world characteristics, the description adds practical implementation details that help the agent use the tool correctly.

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 efficiently structured with clear sections: purpose statement, important behavioral warnings, and practical examples. Every sentence serves a distinct purpose - no wasted words. The examples are directly relevant and help illustrate proper usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity, comprehensive annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), 100% schema coverage, and existence of an output schema, the description provides excellent contextual completeness. It covers key behavioral constraints (truncation, binary handling), usage boundaries, and practical examples - everything needed for effective tool selection and invocation.

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?

With 100% schema description coverage, the schema already documents all three parameters thoroughly. The description provides examples that illustrate parameter usage (file_path and ref in context), but doesn't add significant semantic information beyond what's in the schema. This meets the baseline expectation when schema coverage is complete.

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 specific action ('Read a text file from the repository') and resource ('text file'), and explicitly distinguishes it from sibling tools by mentioning 'Don't use for listings — use gitlab_list_repository_tree.' This provides clear differentiation from related functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('for text content only'), when not to use it ('Don't use for listings'), and names the specific alternative tool ('gitlab_list_repository_tree'). It also warns against using it for binaries due to potential garbage output.

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

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