Skip to main content
Glama

get_file_contents

Retrieve file or directory contents from a GitLab project repository using project ID or namespace and path, with optional branch, tag, or commit reference.

Instructions

Read file or directory content from a project repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch name, tag, or commit SHA (default: default branch / HEAD)
file_pathYesPath to the file or directory in repo (e.g. 'pom.xml' or 'docs/README.md')
project_idYesProject numeric ID (e.g. 31) or namespace path (e.g. 'group/project-name'). URL-encoding is handled automatically.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. 'Read' weakly implies a non-mutating operation, but nothing is disclosed about authentication/permission requirements, whether the ref defaults to HEAD, rate limits, pagination for directory listings, or how binary/large files are handled.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with zero waste, but it is arguably too terse for a 3-parameter repository-read tool, leaving no room for the usage or behavior context the tool needs.

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 tool with no annotations and no output schema, the description should at least indicate what is returned (raw text vs. directory listing) and any size or binary constraints. The schema covers the inputs fully, but the description leaves the return semantics entirely to inference.

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% and all three parameters (project_id, file_path, ref) are well documented in the schema itself, including examples and the default-branch behavior of ref. The description adds nothing beyond that, so the baseline 3 is appropriate.

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?

States a specific verb and resource ('Read file or directory content from a project repository') with the helpful nuance that it accepts both files and directories. An agent can distinguish it from mutation siblings like create_or_update_file, but the description never names an alternative or scope boundary explicitly.

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?

There is no guidance on when to use this tool versus siblings such as get_commit, get_branch, or search_repositories, and no mention of preconditions (e.g., needing a valid project_id). Usage is only implied by the verb 'Read'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.