Skip to main content
Glama

list_issues

Retrieve and filter GitHub repository issues by state, labels, sorting, and date. Simplify issue tracking with pagination and detailed query options for efficient project management.

Instructions

List issues in a GitHub repository with filtering options

Input Schema

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

Implementation Reference

  • Core handler function that fetches the list of issues from the GitHub API using the provided parameters.
    export async function listIssues( github_pat: string, 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( github_pat, buildUrl(`https://api.github.com/repos/${owner}/${repo}/issues`, urlParams) ); }
  • Zod schema defining the input options for listing issues, used for validation and JSON schema generation.
    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(), });
  • src/index.ts:128-132 (registration)
    Tool registration in the ListTools response, defining 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 CallToolRequest that parses arguments and delegates to the issues.listIssues function.
    case "list_issues": { const args = issues._ListIssuesOptionsSchema.parse(params.arguments); const { github_pat, owner, repo, ...options } = args; const result = await issues.listIssues(github_pat, 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/MissionSquad/mcp-github'

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