Skip to main content
Glama

MCP GitLab Server

by Vijay-Duke

gitlab_update_snippet

Update GitLab snippets by modifying title, content, file name, description, or visibility. Use to fix code, update examples, or change permissions, with flexibility to update any combination of fields.

Instructions

Update existing snippet Modifies: Title, content, file name, description, or visibility Use when: Fixing code, updating examples, changing permissions Flexibility: Update any combination of fields

Example usage: { "snippet_id": 123, "title": "Updated API Helper", "content": "// Updated with error handling\nfunction fetchData(url) { ... }", "description": "Enhanced with proper error handling" }

Returns: Updated snippet information

Related tools:

  • gitlab_get_snippet: View current content before updating
  • gitlab_create_snippet: Create new instead of updating

Input Schema

NameRequiredDescriptionDefault
contentNoSnippet content Type: string Format: Raw text content of the snippet Example: 'console.log("Hello World");' Note: Can be code, text, or any content type
descriptionNoSnippet description Type: string Format: Optional description of the snippet Example: 'Helper script for database migrations' Note: Provides context about the snippet's purpose
file_nameNoSnippet file name Type: string Format: File name with extension Example: 'migration.sql', 'helper.py', 'config.yaml' Note: Used for syntax highlighting and display
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
titleNoSnippet title Type: string Format: Descriptive title for the snippet Example: 'Database migration script' Note: Required when creating snippets
visibilityNoSnippet visibility Type: string Format: Visibility level for the snippet Options: 'private' | 'internal' | 'public' Default: 'private' Examples: - 'private' (only visible to author) - 'internal' (visible to authenticated users) - 'public' (visible to everyone)

Input Schema (JSON Schema)

{ "properties": { "content": { "description": "Snippet content\nType: string\nFormat: Raw text content of the snippet\nExample: 'console.log(\"Hello World\");'\nNote: Can be code, text, or any content type", "type": "string" }, "description": { "description": "Snippet description\nType: string\nFormat: Optional description of the snippet\nExample: 'Helper script for database migrations'\nNote: Provides context about the snippet's purpose", "type": "string" }, "file_name": { "description": "Snippet file name\nType: string\nFormat: File name with extension\nExample: 'migration.sql', 'helper.py', 'config.yaml'\nNote: Used for syntax highlighting and display", "type": "string" }, "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" }, "title": { "description": "Snippet title\nType: string\nFormat: Descriptive title for the snippet\nExample: 'Database migration script'\nNote: Required when creating snippets", "type": "string" }, "visibility": { "description": "Snippet visibility\nType: string\nFormat: Visibility level for the snippet\nOptions: 'private' | 'internal' | 'public'\nDefault: 'private'\nExamples:\n - 'private' (only visible to author)\n - 'internal' (visible to authenticated users)\n - 'public' (visible to everyone)", "enum": [ "private", "internal", "public" ], "type": "string" } }, "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