Skip to main content
Glama

Get file contents

gitlab_get_file
Read-only

Read file contents from a GitLab repository, returning text or viewable images by specifying branch, tag, or commit.

Instructions

Reads a file from the repository. Text comes back decoded; set as_image=true to look at an image committed to the repo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag or commit SHA (default: default branch)
as_imageNoReturn the file as a viewable image (for PNG/JPEG/GIF/WebP stored in the repo)
file_pathYesPath inside the repository, e.g. `src/index.ts`
project_idNoProject id or URL-encoded path, e.g. `42` or `group/subgroup/project`. Falls back to GITLAB_PROJECT_ID.
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds behavioral context beyond that: text comes back decoded and as_image=true lets users view repository images. This is meaningful but does not cover auth requirements or response size limits.

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 two sentences with no wasted words. The first sentence front-loads the core purpose, and the second earns its place by explaining the image behavior.

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 simple read operation, the fully documented schema, and read-only annotations, the description is complete enough. It explains the key behavioral nuance (decoded text vs. image) and does not need to detail return values since no output schema is provided. A slight gap is the lack of sibling comparison.

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 parameters are fully documented in the schema. The description mentions as_image but adds no new semantics beyond what the schema already explains.

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 clearly states 'Reads a file from the repository' with a specific verb and resource, and it adds useful detail about decoded text and image mode. However, it does not explicitly distinguish this from sibling tools such as gitlab_blame_file or gitlab_download_url.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like gitlab_list_repo_tree or gitlab_blame_file. The description states what it does but lacks context about exclusions or appropriate scenarios.

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

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