Skip to main content
Glama

Get File Tool

get_file_tool
Read-only

Retrieve a file from a GitLab repository by project ID and path, with optional branch, tag, or commit ref. Returns file metadata and base64-encoded content.

Instructions

Get a file from a GitLab repository.

Returns file metadata and content (base64 encoded).

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

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA (default: HEAD)HEAD
file_pathYesPath to the file in the repository
project_idYesProject ID or path

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

A3.6/5.0
Behavior3/5

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

readOnlyHint=true already tells the agent this is a safe read, so the bar is lower. The description does add one genuinely useful behavioral detail beyond the annotations — that content comes back base64-encoded, which the caller must decode. It says nothing about missing-file behavior, ref resolution failure, or size/binary handling.

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 short sentences, zero filler, with the core purpose front-loaded before the return-format note. Every sentence earns its place.

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?

An output schema exists, so the description needn't enumerate return fields, and all three parameters are covered by the schema. A brief note on the encoding was worth including and is there; only edge-case behavior (not found, binary files, ref errors) is left unaddressed.

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 project_id, file_path, and ref (including the HEAD default) are already fully documented in the schema. The description adds no further parameter meaning, which is the expected baseline when the schema carries the load.

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 from a GitLab repository") and specifies what comes back (metadata plus base64-encoded content). This clearly separates it from the write-side siblings create_file_tool and update_file_tool, though it never names those siblings explicitly.

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?

Usage is implied by the purpose: call this when you need a single file's contents. There is no explicit guidance on when to prefer list_repository_tree_tool or search_project_tool to locate a path first, and no mention of prerequisites such as needing a valid ref.

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