search_issues
Search for issues and pull requests across GitHub repositories. Filter results by criteria like sort order, page number, and per page count. Useful for managing and tracking repository workflows.
Instructions
Search for issues and pull requests across GitHub repositories
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | ||
| page | No | ||
| per_page | No | ||
| q | Yes | ||
| sort | No |
Implementation Reference
- src/operations/search.ts:48-50 (handler)The core handler function that executes the GitHub API call to search for issues and pull requests.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)Zod schema definitions for the search_issues tool: SearchIssuesSchema (public) and _SearchIssuesSchema (internal with github_pat).export const SearchIssuesSchema = SearchIssuesOptions; export const _SearchIssuesSchema = SearchIssuesSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/operations/search.ts:15-29 (schema)Schema options specific to searching issues, extending the base SearchOptions with sort field.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(), });
- src/index.ts:148-152 (registration)Registration of the search_issues tool in the ListTools response, including name, description, and input schema.{ name: "search_issues", description: "Search for issues and pull requests across GitHub repositories", inputSchema: zodToJsonSchema(search.SearchIssuesSchema), },
- src/index.ts:464-471 (registration)Dispatch logic in the CallTool handler that parses input, calls the searchIssues function, and formats the response.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) }], }; }