# get_file_contents

Get contents of a file or directory from a GitLab project

Agent View of the PolicyLayer registry record for `get_file_contents`. HTML page: https://policylayer.com/tools/io-github-zereight-gitlab-mcp/get-file-contents

## Facts

- Tool: `get_file_contents`
- Server: Gitlab Mcp (`@zereight/mcp-gitlab`) — https://policylayer.com/tools/io-github-zereight-gitlab-mcp.md
- Install: `npx -y @zereight/mcp-gitlab`
- Homepage: https://github.com/zereight/gitlab-mcp
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_file_contents",
    "arguments": {}
  }
}
```

## Why get_file_contents is rated Low

This tool retrieves or queries file contents from a GitLab repository without creating, modifying, deleting, or executing anything. It is a pure read operation with minimal blast radius—the worst case is unauthorized information disclosure of repository contents, which is less severe than write, execute, or destructive operations.

From the tool's own definition: "Tool name 'get_file_contents' and description 'Get contents of a file or directory from a GitLab project' indicate retrieval of data with no modification or side effects."

## Use case

AI agents call get_file_contents to retrieve information from Gitlab Mcp without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Gitlab Mcp:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "get_file_contents": {}
  }
}
```

## Other tools on Gitlab Mcp (214)

- `cancel_pipeline_job` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/cancel-pipeline-job.md
- `delete_branch` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-branch.md
- `delete_draft_note` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-draft-note.md
- `delete_group_variable` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-group-variable.md
- `delete_group_wiki_page` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-group-wiki-page.md
- `delete_issue` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-issue.md
- `delete_issue_emoji_reaction` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-issue-emoji-reaction.md
- `delete_issue_link` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-issue-link.md
- `delete_issue_note_emoji_reaction` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-issue-note-emoji-reaction.md
- `delete_label` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-label.md
- `delete_merge_request_discussion_note` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-merge-request-discussion-note.md
- `delete_merge_request_emoji_reaction` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-merge-request-emoji-reaction.md
- `delete_merge_request_note` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-merge-request-note.md
- `delete_merge_request_note_emoji_reaction` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-merge-request-note-emoji-reaction.md
- `delete_milestone` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-milestone.md
- `delete_project_variable` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-project-variable.md
- `delete_release` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-release.md
- `delete_tag` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-tag.md
- `delete_wiki_page` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-wiki-page.md
- `delete_work_item_emoji_reaction` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-work-item-emoji-reaction.md
- `delete_work_item_note_emoji_reaction` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/delete-work-item-note-emoji-reaction.md
- `omg_clear_state` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/omg-clear-state.md
- `omg_delete_memory` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/omg-delete-memory.md
- `purge_dependency_proxy_cache` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/purge-dependency-proxy-cache.md
- `unprotect_branch` — Destructive — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/unprotect-branch.md
- `cancel_pipeline` — Execute — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/cancel-pipeline.md
- `create_pipeline` — Execute — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/create-pipeline.md
- `execute_graphql` — Execute — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/execute-graphql.md
- `omg_next_phase` — Execute — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/omg-next-phase.md
- `play_pipeline_job` — Execute — https://policylayer.com/tools/io-github-zereight-gitlab-mcp/play-pipeline-job.md
- …and 184 more: https://policylayer.com/tools/io-github-zereight-gitlab-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=io-github-zereight-gitlab-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/io-github-zereight-gitlab-mcp
