search_issues
Query and filter issues and pull requests across GitHub repositories by parameters like sort, order, and pagination for targeted results.
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
- operations/search.ts:39-41 (handler)The core handler function implementing the logic for the 'search_issues' tool. It constructs the GitHub API URL for searching issues and makes the request.export async function searchIssues(params: z.infer<typeof SearchIssuesSchema>) { return githubRequest(buildUrl("https://api.github.com/search/issues", params)); }
- operations/search.ts:15-33 (schema)Zod schema definition for the input parameters of the search_issues tool, extending the base SearchOptions with issue-specific sort options. Exported as SearchIssuesSchema.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(), }); export const SearchCodeSchema = SearchOptions; export const SearchUsersSchema = SearchUsersOptions; export const SearchIssuesSchema = SearchIssuesOptions;
- index.ts:140-144 (registration)Tool registration in the MCP server's list of tools, including name, description, and input schema reference.{ name: "search_issues", description: "Search for issues and pull requests across GitHub repositories", inputSchema: zodToJsonSchema(search.SearchIssuesSchema), },
- index.ts:425-431 (registration)Dispatch handler in the MCP server's CallToolRequestHandler that parses arguments, calls the searchIssues function, and returns the results.case "search_issues": { const args = search.SearchIssuesSchema.parse(request.params.arguments); const results = await search.searchIssues(args); return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], }; }