Skip to main content
Glama
ttpears

GitLab MCP Server

by ttpears

Delete Issue

delete_issue
DestructiveIdempotent

Remove a GitLab issue from a project using its project path and issue IID. Requires authentication with delete permissions.

Instructions

Delete a GitLab issue. Requires a user token with permission to delete issues in the project (typically the issue author or a maintainer).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesFull path of the project (e.g., "group/project-name")
iidYesIssue IID (the number shown in the GitLab UI, e.g. "42")
userCredentialsNoYour GitLab credentials (optional — falls back to the configured env token if not provided)

Implementation Reference

  • The Tool definition for 'delete_issue' with its handler function. Validates input (projectPath, iid), requires user authentication, and calls client.destroyIssue(). Returns {projectPath, iid, deleted: true}.
    const deleteIssueTool: Tool = {
      name: 'delete_issue',
      title: 'Delete Issue',
      description:
        'Delete a GitLab issue. Requires a user token with permission to delete issues in the project (typically the issue author or a maintainer).',
      requiresAuth: true,
      requiresWrite: true,
      annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
      inputSchema: withUserAuth(z.object({
        projectPath: z.string().min(1).describe('Full path of the project (e.g., "group/project-name")'),
        iid: z.string().min(1).describe('Issue IID (the number shown in the GitLab UI, e.g. "42")'),
      })),
      handler: async (input, client, userConfig) => {
        const credentials = input.userCredentials ? validateUserConfig(input.userCredentials) : userConfig;
        if (!credentials) {
          throw new Error('User authentication is required for deleting issues.');
        }
        await client.destroyIssue(input.projectPath.trim(), input.iid.trim(), credentials);
        return { projectPath: input.projectPath, iid: input.iid, deleted: true };
      },
    };
  • Input schema for delete_issue: requires projectPath (string) and iid (string), wrapped with user authentication fields.
    inputSchema: withUserAuth(z.object({
      projectPath: z.string().min(1).describe('Full path of the project (e.g., "group/project-name")'),
      iid: z.string().min(1).describe('Issue IID (the number shown in the GitLab UI, e.g. "42")'),
    })),
  • The destroyIssue helper method in GitLabGraphQLClient. Uses the GitLab REST API (DELETE /projects/:id/issues/:iid) because GitLab's GraphQL schema does not expose a destroyIssue mutation. Requires a user token.
    /**
     * Destroy an issue. Uses the REST API (DELETE /projects/:id/issues/:iid)
     * because GitLab's GraphQL schema does not expose a destroyIssue mutation.
     * Requires a user token (or GITLAB_TOKEN if configured as the env fallback).
     */
    async destroyIssue(
      projectPath: string,
      iid: string,
      userConfig?: UserConfig
    ): Promise<void> {
      const encodedPath = encodeURIComponent(projectPath);
      await this.restRequest('DELETE', `/projects/${encodedPath}/issues/${iid}`, {
        userConfig,
        requiresWrite: true,
      });
    }
  • src/tools.ts:2335-2341 (registration)
    The deleteIssueTool is registered in the exported 'tools' array, making it available to the MCP server.
    export const tools: Tool[] = [
      ...readOnlyTools,
      ...userAuthTools,
      ...writeTools,
      updateIssueTool,
      deleteIssueTool,
      updateMergeRequestTool,
Behavior4/5

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

Beyond annotations that indicate destructive and idempotent behavior, the description adds that special permissions are needed. This provides useful context for the agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, both essential: the action and a key prerequisite. No wasted words.

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

Completeness4/5

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

The description covers purpose and a critical permission requirement. For a delete tool with no output schema, it is adequately complete, though could note that deletion is permanent.

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 input schema covers all parameters with clear descriptions, so the description does not add significant meaning beyond what the schema already provides.

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 deletes a GitLab issue, using a specific verb and resource. It distinguishes from sibling tools like delete_note by specifying it's for issues.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear usage condition: requires a user token with permission to delete issues. It does not explicitly mention when not to use it or alternatives, which is acceptable for a simple delete tool.

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

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