Skip to main content
Glama

gitlab_list_issues

Retrieve and list issues from a GitLab project by specifying project ID, optional labels, and issue state (opened or closed).

Instructions

List issues in a GitLab project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelsNoComma-separated list of label names
project_idYesThe ID or URL-encoded path of the project
stateNoReturn issues with specified state (opened, closed)

Implementation Reference

  • The main handler function that implements the gitlab_list_issues tool. It fetches issues from a GitLab project using the API endpoint /projects/{project_id}/issues with optional state and labels parameters.
    export const listIssues: ToolHandler = async (params, context) => {
      const { project_id, state, labels } = params.arguments || {};
      if (!project_id) {
        throw new McpError(ErrorCode.InvalidParams, 'project_id is required');
      }
      
      const response = await context.axiosInstance.get(
        `/projects/${encodeURIComponent(String(project_id))}/issues`,
        { params: { state, labels } }
      );
      return formatResponse(response.data);
    };
  • Registration of the gitlab_list_issues tool in the central tool registry, mapping the tool name to the repoHandlers.listIssues handler function.
    gitlab_list_issues: repoHandlers.listIssues,
  • The input schema definition for the gitlab_list_issues tool, specifying parameters like project_id (required), state, and labels.
    {
      name: 'gitlab_list_issues',
      description: 'List issues in a GitLab project',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'The ID or URL-encoded path of the project'
          },
          state: {
            type: 'string',
            description: 'Return issues with specified state (opened, closed)',
            enum: ['opened', 'closed']
          },
          labels: {
            type: 'string',
            description: 'Comma-separated list of label names'
          }
        },
        required: ['project_id']
      }

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

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