search_issues
Search for issues and pull requests across GitHub repositories to find relevant discussions, track bugs, or monitor project activity.
Instructions
Search for issues and pull requests across GitHub repositories
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | ||
| order | No | ||
| page | No | ||
| per_page | No | ||
| sort | No |
Implementation Reference
- src/operations/search.ts:48-50 (handler)The primary handler function that executes the GitHub API search for issues using the search/issues endpoint.export async function searchIssues(github_pat: string, params: z.infer<typeof SearchIssuesSchema>) { return githubRequest(github_pat, buildUrl("https://api.github.com/search/issues", params)); }
- src/operations/search.ts:39-42 (schema)Defines the Zod schemas for input validation: SearchIssuesSchema (public) and _SearchIssuesSchema (with github_pat).export const SearchIssuesSchema = SearchIssuesOptions; export const _SearchIssuesSchema = SearchIssuesSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/index.ts:150-153 (registration)Registers the tool in the MCP server's listTools response, providing name, description, and input schema.description: "Search for issues and pull requests across GitHub repositories", inputSchema: zodToJsonSchema(search.SearchIssuesSchema), }, {
- src/index.ts:464-471 (handler)The MCP server dispatcher case that parses arguments and calls the searchIssues handler.case "search_issues": { const argsWithPat = search._SearchIssuesSchema.parse(params.arguments); const { github_pat, ...args } = argsWithPat; const results = await search.searchIssues(github_pat, args); return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], }; }
- src/operations/search.ts:15-29 (schema)Base schema options for searching issues, extending common SearchOptions with issue-specific sort options.export const SearchIssuesOptions = SearchOptions.extend({ sort: z.enum([ "comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated", ]).optional(), });