Skip to content

Snippets

Snippets are pieces of code or text kept outside a repository. Personal snippets belong to the user: list, read, create, update and delete them, read their content or one file of it, list every snippet of the instance (an administrator’s), and browse the public ones. Project snippets are the snippet.project_* actions. Threaded discussions and notes on a project snippet, and award emoji on a snippet and on its notes, are actions of this group too.

  • “List my snippets”
  • “Create a snippet with this script”
  • “Show the discussions on snippet 10 of project 42”
  • Dynamic, the default surface: call gitlab_execute_action with action set to the action’s ID, such as snippet.content, and its parameters in params. gitlab_find_action finds an ID from a description of the task.
  • Meta (GITLAB_MCP_TOOL_SURFACE=meta): call gitlab_snippet with action set to the action’s name, such as content, and its parameters in params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): call the action’s own tool, such as gitlab_snippet_content, with its parameters as the arguments.

Every tier serves the whole group, on self-managed instances and on GitLab.com alike.

Read-only actions: 17 of 34, the ones a deployment in read-only mode keeps. A token with read_api and not api is served 17 of the 34.

The description of each action, and of each of its parameters, is the text the server serves for it on the default surface, quoted as served. The token lines say what GitLab 19.6.1 requires of a token for the requests each action sends; on an instance with Admin Mode turned on, an action only an administrator may run also needs admin_mode. A destructive action runs only once confirmed, unless GITLAB_MCP_YOLO_MODE (or AUTOPILOT) skips that step: the dynamic surface needs confirm: true on gitlab_execute_action, and the other two take a confirm parameter or the client’s prompt (Destructive actions). A parameter followed by a tier in parentheses is served only from that tier on.

Action Individual
snippet.content gitlab_snippet_content
snippet.create gitlab_snippet_create
snippet.delete gitlab_snippet_delete
snippet.discussion_add_note gitlab_add_snippet_discussion_note
snippet.discussion_create gitlab_create_snippet_discussion
snippet.discussion_delete_note gitlab_delete_snippet_discussion_note
snippet.discussion_get gitlab_get_snippet_discussion
snippet.discussion_list gitlab_list_snippet_discussions
snippet.discussion_update_note gitlab_update_snippet_discussion_note
snippet.emoji_snippet_create gitlab_snippet_emoji_create
snippet.emoji_snippet_delete gitlab_snippet_emoji_delete
snippet.emoji_snippet_get gitlab_snippet_emoji_get
snippet.emoji_snippet_list gitlab_snippet_emoji_list
snippet.emoji_snippet_note_create gitlab_snippet_note_emoji_create
snippet.emoji_snippet_note_delete gitlab_snippet_note_emoji_delete
snippet.emoji_snippet_note_get gitlab_snippet_note_emoji_get
snippet.emoji_snippet_note_list gitlab_snippet_note_emoji_list
snippet.explore gitlab_snippet_explore
snippet.file_content gitlab_snippet_file_content
snippet.get gitlab_snippet_get
snippet.list gitlab_snippet_list
snippet.list_all gitlab_snippet_list_all
snippet.note_create gitlab_snippet_note_create
snippet.note_delete gitlab_snippet_note_delete
snippet.note_get gitlab_snippet_note_get
snippet.note_list gitlab_snippet_note_list
snippet.note_update gitlab_snippet_note_update
snippet.project_content gitlab_project_snippet_content
snippet.project_create gitlab_project_snippet_create
snippet.project_delete gitlab_project_snippet_delete
snippet.project_get gitlab_project_snippet_get
snippet.project_list gitlab_project_snippet_list
snippet.project_update gitlab_project_snippet_update
snippet.update gitlab_snippet_update

Read a personal snippet’s raw content. Returns: the snippet ID and raw text content. See also: snippet.get, snippet.file_content.

  • Meta-tool: gitlab_snippet, action content
  • Individual tool: gitlab_snippet_content
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
snippet_id integer yes Snippet ID

Create a personal snippet. Returns: the created snippet with ID, visibility, author, files, and web URL. See also: snippet.get, snippet.update, snippet.list.

  • Meta-tool: gitlab_snippet, action create
  • Individual tool: gitlab_snippet_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Snippet: Create at user (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
title string yes Snippet title
content string no Snippet content (single-file, deprecated in favor of files)
description string no Snippet description
file_name string no File name (single-file snippet, deprecated in favor of files)
files object[] no Files to include in the snippet
visibility string (private, internal, public) no Visibility: private, internal, or public. Defaults to private when omitted

Also needs exactly one of: file_name and content; files.

Delete a personal snippet permanently. Returns: a success confirmation. See also: snippet.get, snippet.list.

  • Meta-tool: gitlab_snippet, action delete
  • Individual tool: gitlab_snippet_delete
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Snippet: Delete at user (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
snippet_id integer yes Snippet ID

Add a reply note to an existing snippet discussion thread. Returns: the created note (author, body, timestamps). See also: snippet.discussion_create, snippet.discussion_get, snippet.discussion_update_note.

  • Meta-tool: gitlab_snippet, action discussion_add_note
  • Individual tool: gitlab_add_snippet_discussion_note
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
body string yes Note body (Markdown supported)
discussion_id string yes Discussion ID to reply to
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
created_at string no Backdate the note creation time (ISO 8601, e.g. 2025-01-01T00:00:00Z). Requires admin or owner rights

Create a new discussion thread on a project snippet with an initial note. Returns: the created thread with its first note. See also: snippet.discussion_add_note, snippet.discussion_list, snippet.note_create.

  • Meta-tool: gitlab_snippet, action discussion_create
  • Individual tool: gitlab_create_snippet_discussion
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
body string yes Discussion body (Markdown supported)
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
created_at string no Backdate the discussion creation time (ISO 8601, e.g. 2025-01-01T00:00:00Z). Requires admin or owner rights

Delete a note from a snippet discussion thread (destructive). Returns: a deletion confirmation message. See also: snippet.discussion_update_note, snippet.discussion_get, snippet.discussion_list.

  • Meta-tool: gitlab_snippet, action discussion_delete_note
  • Individual tool: gitlab_delete_snippet_discussion_note
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
discussion_id string yes Discussion ID
note_id integer yes Note ID to delete
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Get a single snippet discussion thread by its discussion id. Returns: the thread with every note (author, body, system flag, resolvable/resolved state). See also: snippet.discussion_list, snippet.discussion_add_note, snippet.project_get.

  • Meta-tool: gitlab_snippet, action discussion_get
  • Individual tool: gitlab_get_snippet_discussion
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
discussion_id string yes Discussion ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

List discussion threads on a project snippet with ordering and offset pagination. Returns: discussion threads with their notes (author, body, system flag, resolvable state) and pagination metadata. See also: snippet.discussion_get, snippet.discussion_create, snippet.project_get, snippet.note_list.

  • Meta-tool: gitlab_snippet, action discussion_list
  • Individual tool: gitlab_list_snippet_discussions
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
order_by string no Column to order results by (e.g. created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort direction (asc or desc)

Update the body of a note in a snippet discussion thread. Returns: the updated note. See also: snippet.discussion_add_note, snippet.discussion_delete_note, snippet.discussion_get.

  • Meta-tool: gitlab_snippet, action discussion_update_note
  • Individual tool: gitlab_update_snippet_discussion_note
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Update at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
body string yes Updated note body
discussion_id string yes Discussion ID
note_id integer yes Note ID to update
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
created_at string no Override the note creation time (ISO 8601, e.g. 2025-01-01T00:00:00Z). Requires admin or owner rights

Add an emoji reaction to a project snippet. Returns: the created award with its emoji name, awarding user object, timestamps, and awardable id/type. See also: snippet.emoji_snippet_list, snippet.emoji_snippet_delete.

  • Meta-tool: gitlab_snippet, action emoji_snippet_create
  • Individual tool: gitlab_snippet_emoji_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
name string yes Emoji name without colons (e.g. thumbsup)
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Remove an emoji reaction from a project snippet by award id. Returns: a success confirmation naming the award emoji. See also: snippet.emoji_snippet_list, snippet.emoji_snippet_get.

  • Meta-tool: gitlab_snippet, action emoji_snippet_delete
  • Individual tool: gitlab_snippet_emoji_delete
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
award_id integer yes Award emoji ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Get a single emoji reaction on a project snippet by award id. Returns: the award with its emoji name, awarding user object, timestamps, and awardable id/type. See also: snippet.emoji_snippet_list, snippet.emoji_snippet_delete.

  • Meta-tool: gitlab_snippet, action emoji_snippet_get
  • Individual tool: gitlab_snippet_emoji_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
award_id integer yes Award emoji ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

List all emoji reactions on a project snippet. Returns: each award with its emoji name, the awarding user object, awardable id/type, and pagination metadata. See also: snippet.emoji_snippet_get, snippet.emoji_snippet_create, snippet.project_get.

  • Meta-tool: gitlab_snippet, action emoji_snippet_list
  • Individual tool: gitlab_snippet_emoji_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
order_by string no Column to order results by (e.g. created_at, updated_at, id).
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort order: ‘asc’ or ‘desc’.

Add an emoji reaction to a project snippet note. Returns: the created award with its emoji name, awarding user object, timestamps, and awardable id/type. See also: snippet.emoji_snippet_note_list, snippet.emoji_snippet_note_delete.

  • Meta-tool: gitlab_snippet, action emoji_snippet_note_create
  • Individual tool: gitlab_snippet_note_emoji_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
name string yes Emoji name without colons (e.g. thumbsup)
note_id integer yes Note ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Remove an emoji reaction from a project snippet note by award id. Returns: a success confirmation naming the award emoji. See also: snippet.emoji_snippet_note_list, snippet.emoji_snippet_note_get.

  • Meta-tool: gitlab_snippet, action emoji_snippet_note_delete
  • Individual tool: gitlab_snippet_note_emoji_delete
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
award_id integer yes Award emoji ID
note_id integer yes Note ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Get a single emoji reaction on a project snippet note by award id. Returns: the award with its emoji name, awarding user object, timestamps, and awardable id/type. See also: snippet.emoji_snippet_note_list, snippet.emoji_snippet_note_delete.

  • Meta-tool: gitlab_snippet, action emoji_snippet_note_get
  • Individual tool: gitlab_snippet_note_emoji_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
award_id integer yes Award emoji ID
note_id integer yes Note ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

List all emoji reactions on a project snippet note (comment). Returns: each award with its emoji name, the awarding user object, awardable id/type, and pagination metadata. See also: snippet.emoji_snippet_note_get, snippet.emoji_snippet_note_create, snippet.note_get.

  • Meta-tool: gitlab_snippet, action emoji_snippet_note_list
  • Individual tool: gitlab_snippet_note_emoji_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
note_id integer yes Note ID
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
order_by string no Column to order results by (e.g. created_at, updated_at, id).
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort order: ‘asc’ or ‘desc’.

List public snippets across the instance. Returns: public snippets with author, visibility, and pagination metadata. See also: snippet.list, snippet.get.

  • Meta-tool: gitlab_snippet, action explore
  • Individual tool: gitlab_snippet_explore
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
order_by string no Column to order results by (e.g. id, created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort direction (asc, desc)

Read one file from a multi-file personal snippet at a ref. Returns: the snippet ID, ref, file name, and raw content. See also: snippet.content, snippet.get.

  • Meta-tool: gitlab_snippet, action file_content
  • Individual tool: gitlab_snippet_file_content
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
file_name string yes File name to retrieve
ref string yes Git ref (branch, tag, or commit SHA)
snippet_id integer yes Snippet ID

Get a single personal snippet by ID. Returns: snippet metadata, visibility, author, files, and web URL. See also: snippet.list, snippet.content, snippet.update, snippet.delete.

  • Meta-tool: gitlab_snippet, action get
  • Individual tool: gitlab_snippet_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
snippet_id integer yes Snippet ID

List snippets owned by the authenticated user. Returns: snippets with title, visibility, author, files, and pagination metadata. See also: snippet.get, snippet.create, snippet.explore.

  • Meta-tool: gitlab_snippet, action list
  • Individual tool: gitlab_snippet_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
order_by string no Column to order results by (e.g. id, created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort direction (asc, desc)

List all snippets on the instance (admin). Returns: snippets with author, visibility, repository storage, and pagination metadata. See also: snippet.list, snippet.explore, snippet.get.

  • Meta-tool: gitlab_snippet, action list_all
  • Individual tool: gitlab_snippet_list_all
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at user (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
created_after string no Filter snippets created after this time, an ISO 8601 timestamp such as 2026-01-01T08:30:00Z. A date such as 2026-01-01 is read as midnight UTC
created_before string no Filter snippets created before this time, an ISO 8601 timestamp such as 2026-02-01T18:00:00Z. A date such as 2026-02-01 is read as midnight UTC
order_by string no Column to order results by (e.g. id, created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
repository_storage (Premium) string no Filter by repository storage name (admin only)
sort string (asc, desc) no Sort direction (asc, desc)

Add a comment (note) to a project snippet. Returns: the created note with id, author, body, and timestamps. See also: snippet.note_list, snippet.note_get, snippet.project_get.

  • Meta-tool: gitlab_snippet, action note_create
  • Individual tool: gitlab_snippet_note_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
body string yes Note body (Markdown supported)
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
created_at string no Backdate the note to this RFC 3339 timestamp (e.g. 2026-01-15T10:00:00Z). Requires administrator or project/group owner permissions. Ignored otherwise.

Delete a snippet note permanently. Returns: a success confirmation naming the note, snippet, and project. See also: snippet.note_get, snippet.note_list.

  • Meta-tool: gitlab_snippet, action note_delete
  • Individual tool: gitlab_snippet_note_delete
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
note_id integer yes ID of the note to delete
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Get a single snippet note by its ID. Returns: the note with author, body, timestamps, and position. See also: snippet.note_list, snippet.note_update, snippet.note_delete.

  • Meta-tool: gitlab_snippet, action note_get
  • Individual tool: gitlab_snippet_note_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
note_id integer yes ID of the note to retrieve
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

List all notes (comments) on a project snippet. Returns: notes with author, body, system flag, and pagination metadata. See also: snippet.note_get, snippet.note_create, snippet.project_get.

  • Meta-tool: gitlab_snippet, action note_list
  • Individual tool: gitlab_snippet_note_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Work Item: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID
order_by string (created_at, updated_at) no Order by field (created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort direction (asc, desc)

Update a snippet note’s body. Returns: the updated note with new body and updated_at timestamp. See also: snippet.note_get, snippet.note_list, snippet.note_delete.

  • Meta-tool: gitlab_snippet, action note_update
  • Individual tool: gitlab_snippet_note_update
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Work Item: Update at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
body string yes Updated note body (Markdown supported)
note_id integer yes ID of the note to update
project_id string/integer yes Project ID or URL-encoded path
snippet_id integer yes Snippet ID

Read a project snippet’s raw content. Returns: the snippet ID and raw text content. See also: snippet.project_get, snippet.project_list.

  • Meta-tool: gitlab_snippet, action project_content
  • Individual tool: gitlab_project_snippet_content
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or path
snippet_id integer yes Snippet ID

Create a project snippet. Returns: the created snippet with ID, visibility, author, files, and web URL. See also: snippet.project_get, snippet.project_update, snippet.project_list.

  • Meta-tool: gitlab_snippet, action project_create
  • Individual tool: gitlab_project_snippet_create
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Snippet: Create at project (permissions page)
  • Behavior: writes, not idempotent
Parameter Type Mandatory Description
project_id string yes Project ID or path
title string yes Snippet title
content string no Content (single-file, deprecated in favor of files)
description string no Snippet description
file_name string no File name (single-file, deprecated in favor of files)
files object[] no Files to include in the snippet
visibility string (private, internal, public) no Visibility: private, internal, or public. Defaults to private when omitted

Also needs exactly one of: file_name and content; files.

Delete a project snippet permanently. Returns: a success confirmation. See also: snippet.project_get, snippet.project_list.

  • Meta-tool: gitlab_snippet, action project_delete
  • Individual tool: gitlab_project_snippet_delete
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Snippet: Delete at project (permissions page)
  • Behavior: writes, destructive (needs confirmation), idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or path
snippet_id integer yes Snippet ID

Get a single project snippet. Returns: snippet metadata, visibility, author, files, and web URL. See also: snippet.project_list, snippet.project_content, snippet.project_update, snippet.project_delete.

  • Meta-tool: gitlab_snippet, action project_get
  • Individual tool: gitlab_project_snippet_get
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or path
snippet_id integer yes Snippet ID

List a project’s snippets. Returns: snippets with title, visibility, author, files, and pagination metadata. See also: snippet.project_get, snippet.project_create, snippet.list.

  • Meta-tool: gitlab_snippet, action project_list
  • Individual tool: gitlab_project_snippet_list
  • Tier: Free
  • Classic or OAuth token: read_api (or api)
  • Fine-grained token: Snippet: Read at project (permissions page)
  • Behavior: read-only, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or path
order_by string no Column to order results by (e.g. id, created_at, updated_at)
page integer no Page number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
per_page integer no Items per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sort string (asc, desc) no Sort direction (asc, desc)

Update a project snippet. Returns: the updated snippet with metadata, files, and web URL. See also: snippet.project_get, snippet.project_delete, snippet.project_list.

  • Meta-tool: gitlab_snippet, action project_update
  • Individual tool: gitlab_project_snippet_update
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Snippet: Update at project (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
project_id string/integer yes Project ID or path
snippet_id integer yes Snippet ID
content string no New content (single-file, deprecated in favor of files)
description string no New description. Pass an empty string to remove it. Omit the field to leave it untouched
file_name string no New file name (single-file, deprecated in favor of files)
files object[] no File operations to apply
title string no New title
visibility string (private, internal, public) no New visibility: private, internal, or public

Update a personal snippet. Returns: the updated snippet with metadata, files, and web URL. See also: snippet.get, snippet.delete, snippet.list.

  • Meta-tool: gitlab_snippet, action update
  • Individual tool: gitlab_snippet_update
  • Tier: Free
  • Classic or OAuth token: api
  • Fine-grained token: Snippet: Update at user (permissions page)
  • Behavior: writes, idempotent
Parameter Type Mandatory Description
snippet_id integer yes Snippet ID
content string no New content (single-file, deprecated in favor of files)
description string no New description. Pass an empty string to remove it. Omit the field to leave it untouched
file_name string no New file name (single-file, deprecated in favor of files)
files object[] no File operations to apply
title string no New title
visibility string (private, internal, public) no New visibility: private, internal, or public