Skip to main content
Glama

get_file_content

Retrieves the content of a specified file in a GitLab project on a given branch or tag, letting AI assistants inspect repository files for code review and analysis.

Instructions

获取指定项目的文件内容

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": {
      "projectPath": "<projectPath>",
      "filePath": "<filePath>"
    },
    "name": "get_file_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo分支或标签,默认为 mainmain
filePathYes文件路径
projectPathYes项目路径,格式: owner/repo

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, yet it adds nothing beyond 'get content'. It does not state that this is a read-only operation, whether it fails or returns empty for a missing path, how large files or binary content are handled, or what form the content is returned in.

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 short sentence with no filler and the core operation front-loaded. Its brevity is close to under-specification, but nothing written is wasted.

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?

With no annotations and no output schema, the description should at least indicate what the return value looks like (raw text, base64, metadata) and error behavior for missing files or invalid refs. None of that is covered, leaving an agent unable to predict the response shape for a 3-parameter read tool.

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%: projectPath (owner/repo format), filePath, and ref (default main) are all documented in the schema itself. The description adds no additional meaning such as path format constraints or ref resolution behavior, so the baseline 3 applies.

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 states a specific verb and resource (get file content) scoped to a project, which is enough for an agent to distinguish it from sibling tools like get_merge_request or analyze_mr_changes that operate on different resources. It does not explicitly name a sibling, but the resource is unambiguous.

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 alternatives, no mention of prerequisites (repository access, whether the file must exist on the given ref), and no exclusions. The agent must infer usage entirely from the tool name.

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