Skip to main content
Glama

gitlab_close_issue

Close a GitLab issue by specifying the project path and issue internal ID. This tool helps manage issue resolution within GitLab projects.

Instructions

Closes a GitLab issue.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesThe path of the GitLab project.
issueIidYesThe internal ID of the issue.

Implementation Reference

  • src/index.ts:926-942 (registration)
    Tool registration and input schema definition for 'gitlab_close_issue'
    {
      name: 'gitlab_close_issue',
      description: 'Closes a GitLab issue.',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'The path of the GitLab project.',
          },
          issueIid: {
            type: 'number',
            description: 'The internal ID of the issue.',
          },
        },
        required: ['projectPath', 'issueIid'],
      },
  • MCP tool handler that dispatches the call to GitLabService.closeIssue
    case 'gitlab_close_issue': {
      if (!gitlabService) {
        throw new Error('GitLab service is not initialized.');
      }
      const { projectPath, issueIid } = args as { projectPath: string; issueIid: number };
      const result = await gitlabService.closeIssue(projectPath, issueIid);
      return {
        content: [
          {
            type: 'text',
            text: `Issue closed successfully: ${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • GitLabService.closeIssue method implementing the core tool logic by calling updateIssue
    // New tool: Close Issue
    async closeIssue(projectPath: string, issueIid: number): Promise<any> {
      return this.updateIssue(projectPath, issueIid, { state: 'close' });
    }
  • Generic updateIssue helper method that sends PUT request to GitLab API, used by closeIssue to set state_event to 'close'
    async updateIssue(projectPath: string, issueIid: number, updates: {
      title?: string;
      description?: string;
      labels?: string[];
      assigneeIds?: number[];
      state?: 'close' | 'reopen';
    }): Promise<any> {
      const encodedProjectPath = encodeURIComponent(projectPath);
      const body: any = {};
      
      if (updates.title) body.title = updates.title;
      if (updates.description) body.description = updates.description;
      if (updates.labels) body.labels = updates.labels.join(',');
      if (updates.assigneeIds) body.assignee_ids = updates.assigneeIds;
      if (updates.state) body.state_event = updates.state;
      
      return this.callGitLabApi<any>(
        `projects/${encodedProjectPath}/issues/${issueIid}`,
        'PUT',
        body,
      );
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral context. It states the action ('Closes') but doesn't disclose permissions needed, whether closing is reversible, what happens to associated data, or error conditions. This is inadequate for a mutation tool with zero annotation coverage.

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?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action, making it easy to scan and understand quickly.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, error handling, return values, and differentiation from siblings, leaving significant gaps for an AI agent to use it correctly.

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?

Schema description coverage is 100%, so the schema fully documents both parameters. The description adds no additional parameter information beyond what's in the schema, but this is acceptable given the high coverage, resulting in a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Closes') and resource ('a GitLab issue'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'gitlab_update_issue' which might also close issues, or explain what 'closing' entails versus other states.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention prerequisites (e.g., issue must be open), when not to use it (e.g., for deleting issues), or how it differs from 'gitlab_update_issue' which might also handle issue state changes.

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

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