list_issues
Retrieve and filter issues from a GitLab project by state, labels, assignee, author, or search terms to track and manage project tasks.
Instructions
List issues in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assignee_id | No | Filter by assignee user ID | |
| author_id | No | Filter by author user ID | |
| labels | No | Comma-separated list of labels | |
| per_page | No | Number of results per page (max 100) | |
| project_id | Yes | Project ID or path | |
| scope | No | Return issues with the given scope (optional) | |
| search | No | Search issues by title and description | |
| state | No | Filter by issue state | opened |
Implementation Reference
- src/handlers/issues.ts:11-33 (handler)The handler function that executes the list_issues tool, constructing query params and fetching issues from GitLab API.async listIssues(args: ListIssuesParams) { const params = new URLSearchParams(); if (args.state) params.append('state', args.state); if (args.labels) params.append('labels', args.labels); if (args.assignee_id) params.append('assignee_id', String(args.assignee_id)); if (args.author_id) params.append('author_id', String(args.author_id)); if (args.search) params.append('search', args.search); // Only add scope if explicitly provided by user if (args.scope) params.append('scope', args.scope); params.append('per_page', String(args.per_page || 20)); const data = await this.client.get(`/projects/${encodeURIComponent(args.project_id)}/issues?${params.toString()}`); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/issues.ts:7-49 (schema)JSON schema defining the input parameters for the list_issues tool.inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, state: { type: 'string', enum: ['opened', 'closed', 'all'], description: 'Filter by issue state', default: 'opened', }, labels: { type: 'string', description: 'Comma-separated list of labels', }, assignee_id: { type: 'number', description: 'Filter by assignee user ID', }, author_id: { type: 'number', description: 'Filter by author user ID', }, search: { type: 'string', description: 'Search issues by title and description', }, scope: { type: 'string', enum: ['created_by_me', 'assigned_to_me', 'all'], description: 'Return issues with the given scope (optional)', }, per_page: { type: 'number', description: 'Number of results per page (max 100)', maximum: 100, default: 20, }, }, required: ['project_id'], },
- src/server.ts:163-166 (registration)Tool call dispatch/registration in the MCP server switch statement.case "list_issues": return await this.issueHandlers.listIssues( args as unknown as ListIssuesParams );
- src/types.ts:215-224 (schema)TypeScript interface for ListIssuesParams providing type definitions matching the tool schema.export interface ListIssuesParams { project_id: string; state?: 'opened' | 'closed' | 'all'; labels?: string; assignee_id?: number; author_id?: number; search?: string; scope?: 'created_by_me' | 'assigned_to_me' | 'all'; per_page?: number; }
- src/tools/issues.ts:4-50 (registration)Tool object definition exported for inclusion in the MCP tools list via allTools.{ name: 'list_issues', description: 'List issues in a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, state: { type: 'string', enum: ['opened', 'closed', 'all'], description: 'Filter by issue state', default: 'opened', }, labels: { type: 'string', description: 'Comma-separated list of labels', }, assignee_id: { type: 'number', description: 'Filter by assignee user ID', }, author_id: { type: 'number', description: 'Filter by author user ID', }, search: { type: 'string', description: 'Search issues by title and description', }, scope: { type: 'string', enum: ['created_by_me', 'assigned_to_me', 'all'], description: 'Return issues with the given scope (optional)', }, per_page: { type: 'number', description: 'Number of results per page (max 100)', maximum: 100, default: 20, }, }, required: ['project_id'], }, },