Skip to main content
Glama

Get File Contents

gitlab_get_file_contents
Read-onlyIdempotent

Fetch file contents from a GitLab repository by path and optional ref to inspect source, config, or docs without cloning.

Instructions

Get a file in repository by path and ref.

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": {
      "file_path": "<file_path>"
    },
    "name": "gitlab_get_file_contents"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
file_pathYes
project_idNo
decode_base64No

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.7.0
    • removedInput schema / properties / decode_base64 / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / decode_base64 / type
      Added value: +[
      +  "boolean",
      +  "null"
      +]
  2. First observedv1.6.1

TDQS

C2.6/5.0
Behavior2/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered without the description. The description adds no behavioral context beyond that: it says nothing about what happens when the ref is omitted (default branch?), how binary content is handled, or what decode_base64 actually changes in the result.

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

Conciseness3/5

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

The single sentence is front-loaded with zero wasted words, which is structurally sound. However, it is under-specified rather than appropriately sized for a four-parameter tool, so the terseness costs more than it saves.

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

Completeness2/5

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

For a four-parameter read tool with no output schema and zero schema description coverage, the definition should explain the ref default, the meaning of decode_base64, and roughly what content comes back. None of that is present, so an agent calling it correctly depends mostly on guessing from parameter names.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning, yet it only names 'path' and 'ref' without adding defaults, format expectations, or validation details. The two remaining parameters, project_id and decode_base64, are never mentioned, leaving their semantics entirely to bare property names.

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 ('Get a file in repository') plus the two key lookup keys (path, ref), so the agent knows it retrieves file content rather than blame or diff data. It does not name or distinguish itself from close siblings such as gitlab_get_file_blame or gitlab_get_merge_request_file_diff, which keeps it out of 5 territory.

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 explicit when-to-use or when-not-to-use guidance and no reference to alternatives; the only signal is the implied 'get file contents by path and ref'. An agent must infer from the name alone that this is the right tool for reading raw file content versus blame, diffs, or artifacts.

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

Deploy Server

Other Tools