Skip to main content
Glama

list_issues

Retrieve and filter issues from a GitLab project using criteria like state, labels, assignee, or date ranges to manage project tasks.

Instructions

List issues in a GitLab project. By default fetches ALL issues automatically across all pages. Only specify 'page' parameter if you need a specific page for manual pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID or URL-encoded path
stateNoFilter issues by state
labelsNoComma-separated list of label names
milestoneNoMilestone title
assignee_idNoUser ID of assignee
author_idNoUser ID of author
searchNoSearch against title and description
created_afterNoReturn issues created after date (ISO 8601)
created_beforeNoReturn issues created before date (ISO 8601)
updated_afterNoReturn issues updated after date (ISO 8601)
updated_beforeNoReturn issues updated before date (ISO 8601)
sortNoSort issues
order_byNoSort order
pageNoPage number for pagination. ONLY specify this if you need a specific page - by default ALL issues are fetched automatically
per_pageNoNumber of results per page (default: 20)
with_labels_detailsNoIf true, returns more details for each label. Default is false.

Implementation Reference

  • The main handler function for list_issues tool, responsible for fetching issues from GitLab API with optional pagination support.
    export async function listIssues(
      projectId: string,
      options: {
        state?: "opened" | "closed" | "all";
        labels?: string;
        milestone?: string;
        assignee_id?: number;
        author_id?: number;
        search?: string;
        created_after?: string;
        created_before?: string;
        updated_after?: string;
        updated_before?: string;
        sort?: string;
        order_by?: "asc" | "desc";
        page?: number;
        per_page?: number;
        with_labels_details?: boolean;
      } = {}
    ): Promise<GitLabIssue[]> {
      if (!projectId?.trim()) {
        throw new Error("Project ID is required");
      }
    
      const endpoint = `/projects/${encodeProjectId(projectId)}/issues`;
    
      // If user explicitly provides page parameter, use single page request
      if (options.page !== undefined) {
        const params = buildSearchParams(options);
        const rawIssues = await gitlabGet<any[]>(endpoint, params);
        return z.array(GitLabIssueSchema).parse(rawIssues);
      }
    
      // Otherwise, fetch all pages automatically
      const allIssues: any[] = [];
      let currentPage = 1;
      const perPage = options.per_page || 100; // Use max page size for efficiency
    
      while (true) {
        const params = buildSearchParams({
          ...options,
          page: currentPage,
          per_page: perPage
        });
    
        const response = await gitlabGetWithHeaders<any[]>(endpoint, params);
        const pageIssues = response.data;
    
        if (pageIssues.length === 0) {
          break; // No more issues
        }
    
        allIssues.push(...pageIssues);
    
        // Check if there's a next page
        const nextPage = response.headers["x-next-page"];
        if (!nextPage) {
          break; // No more pages
        }
    
        currentPage = parseInt(nextPage, 10);
      }
    
      return z.array(GitLabIssueSchema).parse(allIssues);
    }
  • Validation schema for the arguments passed to the list_issues tool.
    export const ListIssuesSchema = z.object({
      project_id: z.string().describe("Project ID or URL-encoded path"),
      state: z.enum(["opened", "closed", "all"]).optional().describe("Filter issues by state"),
      labels: z.string().optional().describe("Comma-separated list of label names"),
      milestone: z.string().optional().describe("Milestone title"),
      assignee_id: z.number().optional().describe("User ID of assignee"),
      author_id: z.number().optional().describe("User ID of author"),
      search: z.string().optional().describe("Search against title and description"),
      created_after: z.string().optional().describe("Return issues created after date (ISO 8601)"),
      created_before: z.string().optional().describe("Return issues created before date (ISO 8601)"),
      updated_after: z.string().optional().describe("Return issues updated after date (ISO 8601)"),
      updated_before: z.string().optional().describe("Return issues updated before date (ISO 8601)"),
      sort: z
        .enum([
          "created_at",
          "updated_at",
          "priority",
          "due_date",
          "relative_position",
          "label_priority",
          "milestone_due",
          "popularity",
          "weight"
        ])
        .optional()
        .describe("Sort issues"),
      order_by: z.enum(["asc", "desc"]).optional().describe("Sort order"),
      page: z
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: automatic pagination across all pages by default, and the conditional use of the 'page' parameter. However, it doesn't mention rate limits, authentication requirements, or error handling, leaving some gaps.

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 front-loaded with the core purpose and key behavioral detail in just two sentences. Every word earns its place—no fluff or redundancy. It efficiently communicates essential information without unnecessary elaboration.

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?

Given the complexity (16 parameters, no annotations, no output schema), the description is reasonably complete. It covers the main behavioral aspect (automatic pagination) but could better address authentication, rate limits, or error scenarios to fully prepare an agent for real-world use.

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 16 parameters thoroughly. The description adds minimal value beyond the schema by emphasizing the default pagination behavior for the 'page' parameter, but doesn't provide additional semantic context for other parameters.

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 verb ('List') and resource ('issues in a GitLab project'), making the purpose specific. It distinguishes from sibling tools like 'search_issues' by emphasizing it fetches ALL issues automatically across pages, while search_issues likely performs text-based searches.

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 the 'page' parameter ('Only specify if you need a specific page for manual pagination') and contrasts with the default behavior of fetching all pages automatically. This gives clear context for parameter usage.

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

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