Skip to main content
Glama
kunwarVivek

mcp-github-project-manager

list_issues

Retrieve GitHub issues by filtering 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

  • Core handler function implementing the list_issues tool logic. Fetches issues from repository, applies filters for status, milestone, labels, assignee; sorts by created/updated/comments; limits results.
    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);
      }
    }
  • Tool definition including input schema, description, and examples for list_issues. References listIssuesSchema defined earlier (lines 145-156).
    export const listIssuesTool: ToolDefinition<ListIssuesArgs> = {
      name: "list_issues",
      description: "List GitHub issues",
      schema: listIssuesSchema as unknown as ToolSchema<ListIssuesArgs>,
      examples: [
        {
          name: "List open issues for milestone",
          description: "List open issues assigned to a specific milestone",
          args: {
            status: "open",
            milestone: "1",
            sort: "updated",
            direction: "desc",
            limit: 10
          }
        }
      ]
    };
  • Registration of the listIssuesTool (along with other issue tools) in the central ToolRegistry singleton during initialization.
    this.registerTool(createIssueTool);
    this.registerTool(listIssuesTool);
    this.registerTool(getIssueTool);
    this.registerTool(updateIssueTool);
  • MCP tool dispatch handler in main server that routes list_issues calls to ProjectManagementService.listIssues
    case "list_issues":
      return await this.service.listIssues(args);
  • Repository helper method findAll() that executes GraphQL query to fetch issues from GitHub API, used by service.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 full burden for behavioral disclosure. 'List GitHub issues' implies a read-only operation but doesn't specify permissions, rate limits, pagination, or output format. This leaves critical behavioral traits undocumented for a tool with 7 parameters.

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 efficient. There's no wasted verbiage, though this brevity contributes to gaps in other dimensions.

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?

For a tool with 7 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain parameter usage, behavioral constraints, or output expectations, leaving the agent with insufficient context for effective use.

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 parameters like 'status', 'milestone', 'labels', 'assignee', 'sort', 'direction', and 'limit' are completely undocumented in the schema. The description adds no semantic information about these parameters, failing to compensate for the coverage gap.

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'), making the basic purpose understandable. However, it doesn't differentiate from sibling tools like 'get_issue' (singular) or 'list_project_items', leaving ambiguity about scope and specificity.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_issue' (for single issues), 'list_project_items' (for project-specific items), and 'triage_all_issues' (for triaging), the description offers no context on selection criteria or exclusions.

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/kunwarVivek/mcp-github-project-manager'

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