Skip to main content
Glama

gitlab_update_snippet

Modify existing GitLab snippets by updating title, content, file name, description, or visibility settings to fix code, update examples, or change permissions.

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

TableJSON 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
titleNoSnippet title Type: string Format: Descriptive title for the snippet Example: 'Database migration script' Note: Required when creating snippets
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
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
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)
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool 'Modifies' fields and 'Returns: Updated snippet information', which covers basic behavioral traits. However, it lacks details on permissions required, error handling, or rate limits. The description doesn't contradict any annotations (none exist), but it provides only moderate behavioral context beyond the obvious update 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?

The description is well-structured with clear sections (purpose, modifications, usage context, flexibility, example, returns, related tools) and uses bullet points for readability. It is appropriately sized, but some redundancy exists (e.g., listing fields in 'Modifies' and the example). Overall, it's efficient with minimal waste.

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

Completeness3/5

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

Given the complexity (update operation with 7 parameters), no annotations, and no output schema, the description is moderately complete. It covers purpose, usage, parameters via example, and return info, but lacks details on behavioral aspects like authentication needs or error responses. It's adequate for basic use but has gaps for a mutation tool without structured support.

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

Parameters3/5

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

The schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds minimal value beyond the schema by listing modifiable fields ('Title, content, file name, description, or visibility') and providing an example usage. This meets the baseline of 3, as the schema does the heavy lifting, but the description doesn't add significant semantic depth.

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 the tool's purpose with a specific verb ('Update') and resource ('existing snippet'), and distinguishes it from sibling tools like gitlab_create_snippet (for creating new snippets) and gitlab_get_snippet (for viewing before updating). The opening line 'Update existing snippet' is direct and unambiguous.

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?

The description provides explicit guidance on when to use this tool ('Use when: Fixing code, updating examples, changing permissions') and includes a 'Related tools' section that names alternatives (gitlab_get_snippet for viewing before updating, gitlab_create_snippet for creating new instead). This clearly differentiates it from sibling tools and provides context for selection.

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/Vijay-Duke/mcp-gitlab'

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