Skip to main content
Glama

Snippet

gitlab_snippet
Destructive

CRUD GitLab snippets, manage threaded discussions, notes, and award emoji. Supports personal and project-scoped snippets with content and metadata operations, including browse and explore.

Instructions

Example: {"action":"content","params":{...}} For the params schema of any action, read the MCP resource gitlab://schema/meta/gitlab_snippet/.

Manage GitLab snippets (personal, project-scoped, and explore feed): CRUD snippet metadata and content, threaded discussions, notes (project snippets only), and award emoji on snippets and snippet notes. Delete is destructive and irreversible. When to use: store/share standalone code or text outside a repo, comment on existing snippets, react with emoji on a snippet or snippet note, browse public snippets via explore. NOT for: files in a repository (use gitlab_repository), wiki pages (use gitlab_wiki), MR/issue notes (use gitlab_mr_review or gitlab_issue), custom group emoji (use gitlab_custom_emoji — enterprise).

Returns:

  • *_list / list_all / explore: array with pagination.

  • *_get / *_create / *_update: snippet object {id, title, file_name, files, visibility, author, web_url, raw_url}.

  • content / project_content: raw snippet body as text.

  • file_content: raw content of a single file in a multi-file snippet.

  • discussion_* / note_*: discussion or note object.

  • emoji_*: award emoji object.

  • *_delete: {success: bool, message: string}. Errors: 404 not found, 403 forbidden (hint: requires Reporter+ for project snippets; private snippets require ownership), 400 invalid params (hint: visibility ∈ private/internal/public).

Param conventions: * = required. List actions accept page, per_page. visibility ∈ private/internal/public.

Personal snippets:

  • list / list_all / explore: (no required params)

  • get / content: snippet_id*

  • file_content: snippet_id*, file_path*

  • create: title*, file_name*, content*, visibility, description

  • update: snippet_id*, title, file_name, content, visibility, description

  • delete: snippet_id*

Project snippets:

  • project_list: project_id*

  • project_get / project_content: project_id*, snippet_id*

  • project_create: project_id*, title*, file_name*, content*, visibility

  • project_update: project_id*, snippet_id*, title, file_name, content, visibility

  • project_delete: project_id*, snippet_id*

Discussions (threaded):

  • discussion_list: snippet_id*

  • discussion_get: snippet_id*, discussion_id*

  • discussion_create: snippet_id*, body*

  • discussion_add_note: snippet_id*, discussion_id*, body*

  • discussion_update_note: snippet_id*, discussion_id*, note_id*, body*

  • discussion_delete_note: snippet_id*, discussion_id*, note_id*

Notes (project snippets only) — all need project_id*, snippet_id*:

  • note_list: order_by, sort

  • note_get / note_delete: note_id*

  • note_create: body*

  • note_update: note_id*, body*

Award emoji — all need project_id*, snippet_id* (snippet emoji) or project_id*, snippet_id*, note_id* (note emoji):

  • emoji_snippet_list / emoji_snippet_note_list: (no extra params)

  • emoji_snippet_get / emoji_snippet_note_get: award_id*

  • emoji_snippet_create / emoji_snippet_note_create: name*

  • emoji_snippet_delete / emoji_snippet_note_delete: award_id*

See also: gitlab_repository (project files and commits), gitlab_wiki (long-form project docs), gitlab_project (project membership and visibility), gitlab_custom_emoji (define group-level custom emoji).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform. Pick exactly one of the values in `enum`. Each action expects its own `params` object — see the tool description for the per-action parameter list.
paramsNoAction-specific parameters as a JSON object. Required and optional fields differ per action; consult this tool's description for the chosen action. Send only the fields documented for that action — unknown keys are rejected with a validation error (only reserved meta keys like `confirm` are stripped before validation). For the JSON Schema of a specific action's `params`, read the MCP resource `gitlab://schema/meta/{tool}/{action}` (replace placeholders with the tool name and the chosen action).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
next_stepsNoOptional. Suggested follow-up actions or tool calls for the LLM, contextual to the result.
paginationNoPresent on list actions. Use `has_more` and `next_page` to paginate through results.
Behavior5/5

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

Even though annotations indicate destructiveHint and openWorldHint, the description adds extensive behavioral context: delete is irreversible, error types and hints, visibility constraints, and parameter conventions. This goes beyond what annotations provide.

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?

The description is well-organized with clear sections (overview, when to use, returns, errors, conventions, action lists). However, it is quite long; some redundancy could be trimmed, but the structure makes it easy to navigate.

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

Completeness5/5

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

Given the high complexity (many actions, multiple scopes, return types, error handling, sibling differentiation), the description covers all needed context comprehensively. It even accounts for output shapes and error hints.

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

Parameters5/5

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

The input schema has good descriptions for action and params, and the description provides detailed per-action parameter lists, including required vs optional fields, and even references MCP resources for further schema details. This adds significant meaning beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it manages snippets with CRUD operations, threaded discussions, notes, and award emoji. It distinguishes itself from siblings by explicitly listing what it's not for, such as gitlab_repository and gitlab_wiki.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides a 'When to use' section with specific scenarios and a 'NOT for' section listing alternative tools. Also includes a 'See also' list for related tools.

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

Install Server

Other Tools

Latest Blog Posts

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/jmrplens/gitlab-mcp-server'

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