delete_tag
Remove a GitLab tag from a project using its ID and tag name.
Instructions
Delete a tag.
Args:
project_id: GitLab project ID
tag_name: Tag name to delete
token: GitLab Personal Access Token (optional)
ctx: MCP context (automatically injected)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| tag_name | Yes | ||
| token | No | ||
| ctx | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- Handler function for the 'delete_tag' MCP tool. It sends a DELETE request to the GitLab API endpoint /projects/{project_id}/repository/tags/{tag_name} to delete a repository tag.
@mcp.tool() async def delete_tag(project_id: int, tag_name: str, token: str = None, ctx=None) -> str: """Delete a tag. Args: project_id: GitLab project ID tag_name: Tag name to delete token: GitLab Personal Access Token (optional) ctx: MCP context (automatically injected) """ import urllib.parse encoded_tag = urllib.parse.quote(tag_name, safe='') result = await make_gitlab_request(f"/projects/{project_id}/repository/tags/{encoded_tag}", "DELETE", ctx=ctx, token=token) if isinstance(result, dict) and "error" in result: return f"Error deleting tag: {result['error']}" return f"Tag '{tag_name}' deleted successfully" - gitlab_clone_mcp_server/server.py:843-843 (registration)Registration of 'delete_tag' as an MCP tool via the @mcp.tool() decorator on the async function.
@mcp.tool()