Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

list-issues

Retrieve and filter GitHub repository issues by status, labels, sort order, and date range to track and manage project tasks effectively.

Instructions

List and filter repository issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionNo
labelsNo
ownerYes
pageNo
per_pageNo
repoYes
sinceNo
sortNo
stateNo

Implementation Reference

  • The main handler function that executes the list-issues tool logic, parsing input, calling GitHub API, and formatting the response.
    export async function listIssues(args: unknown): Promise<any> { const { owner, repo, state, labels, sort, direction, since, page, per_page } = ListIssuesSchema.parse(args); const github = getGitHubApi(); return tryCatchAsync(async () => { const { data } = await github.getOctokit().issues.listForRepo({ owner, repo, state, labels: labels?.join(','), sort, direction, since, page, per_page, }); return data.map((issue) => ({ id: issue.id, number: issue.number, title: issue.title, state: issue.state, locked: issue.locked, assignees: issue.assignees?.map((assignee) => ({ login: assignee.login, id: assignee.id, type: assignee.type, })), user: issue.user ? { login: issue.user.login, id: issue.user.id, type: issue.user.type, } : null, labels: issue.labels?.map((label) => typeof label === 'string' ? label : { name: label.name, color: label.color, description: label.description, } ), milestone: issue.milestone ? { id: issue.milestone.id, number: issue.milestone.number, title: issue.milestone.title, description: issue.milestone.description, state: issue.milestone.state, } : null, comments: issue.comments, created_at: issue.created_at, updated_at: issue.updated_at, closed_at: issue.closed_at, body: issue.body, url: issue.html_url, pull_request: issue.pull_request ? { url: issue.pull_request.html_url, } : null, })); }, 'Failed to list issues'); }
  • Registration in the tool dispatch switch statement within the CallToolRequestHandler.
    case 'list-issues': result = await listIssues(parsedArgs); break;
  • Zod schema for input validation used in the listIssues handler.
    export const ListIssuesSchema = OwnerRepoSchema.extend({ state: z.enum(['open', 'closed', 'all']).optional(), labels: z.array(z.string()).optional(), sort: z.enum(['created', 'updated', 'comments']).optional(), direction: z.enum(['asc', 'desc']).optional(), since: z.string().optional(), page: z.number().optional(), per_page: z.number().optional(), });
  • src/server.ts:523-564 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    name: 'list-issues', description: 'List and filter repository issues', inputSchema: { type: 'object', properties: { owner: { type: 'string', }, repo: { type: 'string', }, state: { type: 'string', enum: ['open', 'closed', 'all'], }, labels: { type: 'array', items: { type: 'string', }, }, sort: { type: 'string', enum: ['created', 'updated', 'comments'], }, direction: { type: 'string', enum: ['asc', 'desc'], }, since: { type: 'string', }, page: { type: 'number', }, per_page: { type: 'number', }, }, required: ['owner', 'repo'], additionalProperties: false, },
  • Import statement bringing in the listIssues handler function.
    import { listIssues, getIssue, createIssue, updateIssue, addIssueComment, searchIssues as searchIssuesAndPRs, } from './tools/issues.js';

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/piyushgIITian/github-enterprice-mcp'

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