Skip to main content
Glama

list_issues

Retrieve and filter issues from a GitHub repository by specifying owner, repo, labels, state, and sorting options for efficient issue management.

Instructions

List issues in a GitHub repository with filtering options

Input Schema

NameRequiredDescriptionDefault
directionNo
labelsNo
ownerYes
pageNo
per_pageNo
repoYes
sinceNo
sortNo
stateNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "direction": { "enum": [ "asc", "desc" ], "type": "string" }, "labels": { "items": { "type": "string" }, "type": "array" }, "owner": { "type": "string" }, "page": { "type": "number" }, "per_page": { "type": "number" }, "repo": { "type": "string" }, "since": { "type": "string" }, "sort": { "enum": [ "created", "updated", "comments" ], "type": "string" }, "state": { "enum": [ "open", "closed", "all" ], "type": "string" } }, "required": [ "owner", "repo" ], "type": "object" }

Implementation Reference

  • The core handler function that executes the list_issues tool logic by constructing GitHub API URL with filters and fetching issues.
    export async function listIssues( owner: string, repo: string, options: Omit<z.infer<typeof ListIssuesOptionsSchema>, "owner" | "repo"> ) { const urlParams: Record<string, string | undefined> = { direction: options.direction, labels: options.labels?.join(","), page: options.page?.toString(), per_page: options.per_page?.toString(), since: options.since, sort: options.sort, state: options.state }; return githubRequest( buildUrl(`https://api.github.com/repos/${owner}/${repo}/issues`, urlParams) ); }
  • Zod schema for input validation of list_issues tool parameters including repository identifiers and filtering options.
    export const ListIssuesOptionsSchema = z.object({ owner: z.string(), repo: z.string(), direction: z.enum(["asc", "desc"]).optional(), labels: z.array(z.string()).optional(), page: z.number().optional(), per_page: z.number().optional(), since: z.string().optional(), sort: z.enum(["created", "updated", "comments"]).optional(), state: z.enum(["open", "closed", "all"]).optional(), });
  • index.ts:124-127 (registration)
    Registration of the list_issues tool in the MCP server's tools list, providing name, description, and input schema.
    name: "list_issues", description: "List issues in a GitHub repository with filtering options", inputSchema: zodToJsonSchema(issues.ListIssuesOptionsSchema) },
  • Dispatch handler in the main CallToolRequestSchema that parses arguments, extracts owner/repo/options, calls the listIssues function, and formats the response.
    case "list_issues": { const args = issues.ListIssuesOptionsSchema.parse(request.params.arguments); const { owner, repo, ...options } = args; const result = await issues.listIssues(owner, repo, options); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }

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/PhialsBasement/mcp-github-server-plus'

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