Skip to main content
Glama

list_issues

Retrieve GitHub issues with filters for status, assignee, labels, milestone, and sorting options to manage project tasks effectively.

Instructions

List GitHub issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
milestoneNo
labelsNo
assigneeNo
sortNo
directionNo
limitNo

Implementation Reference

  • Primary handler function implementing list_issues tool logic: fetches issues (by milestone or all), filters by status/labels/assignee, sorts, limits.
    async listIssues(options: {
      status?: string;
      milestone?: string;
      labels?: string[];
      assignee?: string;
      sort?: string;
      direction?: string;
      limit?: number;
    } = {}): Promise<Issue[]> {
      try {
        // Set default values
        const {
          status = 'open',
          milestone,
          labels = [],
          assignee,
          sort = 'created',
          direction = 'desc',
          limit = 30
        } = options;
    
        let issues: Issue[];
    
        if (milestone) {
          // If milestone is specified, get issues for that milestone
          issues = await this.issueRepo.findByMilestone(milestone);
        } else {
          // Otherwise get all issues
          issues = await this.issueRepo.findAll();
        }
    
        // Filter by status
        if (status !== 'all') {
          const resourceStatus = status === 'open' ? ResourceStatus.ACTIVE : ResourceStatus.CLOSED;
          issues = issues.filter(issue => issue.status === resourceStatus);
        }
    
        // Filter by labels if provided
        if (labels.length > 0) {
          issues = issues.filter(issue =>
            labels.every(label => issue.labels.includes(label))
          );
        }
    
        // Filter by assignee if provided
        if (assignee) {
          issues = issues.filter(issue =>
            issue.assignees.includes(assignee)
          );
        }
    
        // Sort the issues
        issues.sort((a, b) => {
          let valueA, valueB;
    
          switch(sort) {
            case 'updated':
              valueA = a.updatedAt;
              valueB = b.updatedAt;
              break;
            case 'comments':
              // Since we don't have comment count in our model, default to created
            case 'created':
            default:
              valueA = a.createdAt;
              valueB = b.createdAt;
          }
    
          const comparison = valueA.localeCompare(valueB);
          return direction === 'desc' ? -comparison : comparison;
        });
    
        // Apply limit
        return issues.slice(0, limit);
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema definition for list_issues tool input validation and TypeScript type inference.
    // Schema for list_issues tool
    export const listIssuesSchema = z.object({
      status: z.enum(["open", "closed", "all"]).default("open"),
      milestone: z.string().optional(),
      labels: z.array(z.string()).optional(),
      assignee: z.string().optional(),
      sort: z.enum(["created", "updated", "comments"]).default("created").optional(),
      direction: z.enum(["asc", "desc"]).default("desc").optional(),
      limit: z.number().int().positive().default(30).optional(),
    });
    
    export type ListIssuesArgs = z.infer<typeof listIssuesSchema>;
  • Registers the listIssuesTool in the central ToolRegistry singleton.
    this.registerTool(listIssuesTool);
  • MCP tool dispatch handler that routes list_issues calls to ProjectManagementService.listIssues.
    case "list_issues":
      return await this.service.listIssues(args);
  • Repository helper: Fetches all issues via GraphQL and maps to domain Issue model (used by listIssues).
    async findAll(): Promise<Issue[]> {
      const query = `
        query($owner: String!, $repo: String!) {
          repository(owner: $owner, name: $repo) {
            issues(first: 100) {
              nodes {
                id
                number
                title
                body
                state
                createdAt
                updatedAt
                assignees(first: 100) {
                  nodes {
                    login
                  }
                }
                labels(first: 100) {
                  nodes {
                    name
                  }
                }
                milestone {
                  id
                }
              }
            }
          }
        }
      `;
    
      const response = await this.graphql<ListIssuesResponse>(query, {
        owner: this.owner,
        repo: this.repo,
      });
    
      return response.repository.issues.nodes.map(issue =>
        this.mapGitHubIssueToIssue(issue)
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'List GitHub issues' implies a read-only operation but does not specify critical traits like pagination behavior, rate limits, authentication requirements, error handling, or return format. For a tool with 7 parameters and no output schema, this is a significant gap in transparency.

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 extremely concise with just three words, making it front-loaded and waste-free. Every word ('List', 'GitHub', 'issues') contributes directly to the core purpose, though this brevity comes at the cost of completeness. It efficiently communicates the basic intent without unnecessary elaboration.

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 (7 parameters, 1 required), lack of annotations, and no output schema, the description is incomplete. It does not address parameter meanings, behavioral traits, or output expectations, leaving significant gaps for the agent to navigate. For a listing tool with multiple filtering options, more context is needed to be adequately helpful.

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

Parameters1/5

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

The input schema has 7 parameters with 0% description coverage, and the tool description provides no information about any parameters. It does not explain what 'status', 'milestone', 'labels', etc., mean, their expected formats, or how they affect the listing. With low schema coverage and no compensation in the description, this fails to add value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List GitHub issues' clearly states the verb ('List') and resource ('GitHub issues'), providing a basic understanding of the tool's function. However, it lacks specificity about scope (e.g., repository, organization) and does not differentiate from sibling tools like 'get_issue' (which fetches a single issue) or 'list_project_items' (which might include issues). This makes it vague but not tautological.

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. It does not mention context such as filtering needs, comparison to 'get_issue' for single issues, or prerequisites like repository selection. Without any implied or explicit usage instructions, it leaves the agent to infer based on 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/HarshKumarSharma/MCP'

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