get_issue
Retrieve detailed information about a specific GitHub issue by providing repository owner, repository name, and issue number.
Instructions
Get details of a specific issue in a GitHub repository.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | ||
| repo | Yes | ||
| issue_number | Yes |
Implementation Reference
- src/operations/issues.ts:75-77 (handler)The core handler function that executes the tool logic by making a GitHub API request to fetch the specified issue.export async function getIssue(github_pat: string, owner: string, repo: string, issue_number: number) { return githubRequest(github_pat, `https://api.github.com/repos/${owner}/${repo}/issues/${issue_number}`); }
- src/operations/issues.ts:4-12 (schema)Zod schemas for input validation: GetIssueSchema defines owner, repo, issue_number; _GetIssueSchema adds github_pat.export const GetIssueSchema = z.object({ owner: z.string(), repo: z.string(), issue_number: z.number(), }); export const _GetIssueSchema = GetIssueSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/index.ts:158-162 (registration)Tool registration in the MCP server's listTools response, specifying name, description, and input schema.{ name: "get_issue", description: "Get details of a specific issue in a GitHub repository.", inputSchema: zodToJsonSchema(issues.GetIssueSchema) },
- src/index.ts:524-530 (registration)Dispatch logic in the CallToolRequest handler that validates arguments and invokes the getIssue handler.case "get_issue": { const args = issues._GetIssueSchema.parse(params.arguments); const issue = await issues.getIssue(args.github_pat, args.owner, args.repo, args.issue_number); return { content: [{ type: "text", text: JSON.stringify(issue, null, 2) }], }; }