Skip to main content
Glama

Snippet

gitlab_snippet
Destructive

Create, update, delete, and explore GitLab snippets. Manage threaded discussions, notes, and award emoji on snippets and notes.

Instructions

Use {"action":"content","params":{...}}; only top-level keys are action and params. Action params schema: 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, visibility, files* to change snippet file content. For updating existing content use files: [{"action":"update","file_path":"","content":"..."}]; do not put file_path/content directly under params.

  • 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. This envelope schema stays broad; runtime validation applies the chosen action's schema after reserved meta keys like `confirm` are stripped. 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?

Beyond annotations (destructiveHint, openWorldHint), the description confirms delete is irreversible, explains open-world via per-action schemas, details error codes and hints for 404/403/400, and describes return shapes for each action.

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?

Well-structured with sections and bullet lists, front-loading the core structure. However, some repetition (e.g., repeated snippet_id* across actions) could be more concise. Still fairly efficient for the complexity.

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?

Extremely complete: covers all actions, scopes (personal, project, explore), return types, error codes, parameter lists, and references sibling tools. Output schema exists (mentioned), and description compensates for any input schema brevity.

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

Parameters4/5

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

Schema coverage is 100% (action and params described), but the description adds significant value by listing per-action required/optional params, including conventions like * for required and visibility values. Baseline 3, but extra detail merits 4.

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?

The description clearly states it manages GitLab snippets, listing all capabilities (CRUD, discussions, notes, emoji) and explicitly distinguishes from sibling tools by stating what it is NOT for, such as files in a repository or wiki pages.

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?

Excellent guidance: describes when to use (store/share code, comment, react, browse) and when not to use, with specific sibling tool names. Also provides permission hints for project vs. private snippets.

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