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';
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. It mentions filtering but doesn't describe pagination behavior (implied by 'page' and 'per_page' parameters), rate limits, authentication needs, or what the output looks like. For a tool with 9 parameters and no output schema, this is inadequate.

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 zero wasted words. It's front-loaded with the core action ('List and filter'), 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?

Given the complexity (9 parameters, no annotations, no output schema), the description is severely incomplete. It doesn't explain parameter usage, output format, pagination, or behavioral constraints, leaving the agent with significant gaps in understanding how to invoke the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but fails to do so. It mentions filtering generically but doesn't explain any of the 9 parameters (e.g., what 'since' expects, how 'labels' work, or the meaning of 'state' enums). This leaves critical semantics undocumented.

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 tool's purpose with a specific verb ('List and filter') and resource ('repository issues'), making it immediately understandable. It distinguishes from siblings like 'get-issue' (single issue) and 'search-issues' (broader search), though it doesn't explicitly name these alternatives.

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?

The description provides no guidance on when to use this tool versus alternatives like 'search-issues' or 'get-issue'. It mentions filtering but doesn't clarify scope, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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

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