Skip to main content
Glama

MCP GitLab Server

by Vijay-Duke

gitlab_get_snippet

Retrieve detailed information and full content of a GitLab snippet by its ID, including title, file name, visibility, author, and created date. Use for reviewing code implementations or accessing shared utilities directly from projects.

Instructions

Get snippet details and content Returns: Complete snippet information with content Use when: Reading snippet code, reviewing implementations Content: Full text content included

Example response: { "id": 123, "title": "API Helper Functions", "file_name": "api_helpers.js", "content": "function fetchData(url) { ... }", "description": "Common API utility functions", "visibility": "internal", "author": {"name": "Jane Smith"}, "created_at": "2023-01-01T00:00:00Z", "web_url": "https://gitlab.com/group/project/snippets/123" }

Related tools:

  • gitlab_list_snippets: Browse available snippets
  • gitlab_update_snippet: Modify snippet

Input Schema

NameRequiredDescriptionDefault
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted
snippet_idYesSnippet ID Type: integer Format: Numeric snippet identifier Example: 123 How to find: From snippet URL or API responses

Input Schema (JSON Schema)

{ "properties": { "project_id": { "description": "Project identifier (auto-detected if not provided)\nType: integer OR string\nFormat: numeric ID or 'namespace/project'\nOptional: Yes - auto-detects from current git repository\nExamples:\n - 12345 (numeric ID)\n - 'gitlab-org/gitlab' (namespace/project path)\n - 'my-group/my-subgroup/my-project' (nested groups)\nNote: If in a git repo with GitLab remote, this can be omitted", "type": "string" }, "snippet_id": { "description": "Snippet ID\nType: integer\nFormat: Numeric snippet identifier\nExample: 123\nHow to find: From snippet URL or API responses", "type": "integer" } }, "required": [ "snippet_id" ], "type": "object" }

Other Tools from MCP GitLab Server

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vijay-Duke/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server