feat: add get_issue endpoint to retrieve single issue details

Adds functionality to fetch details of a specific GitHub issue by number.
This includes:
- New GetIssueSchema for input validation
- Implementation of getIssue function using GitHub API
- Addition of get_issue tool to available tools list
- Handler for get_issue in CallToolRequestSchema

This allows users to retrieve complete issue information including:
- Issue metadata (title, body, state)
- Associated data (labels, assignees, milestone)
- Timestamps (created, updated, closed)
This commit is contained in:
Aschent89
2024-12-06 14:03:12 -05:00
parent 2ecb382a02
commit 6d7a8f2267
2 changed files with 45 additions and 0 deletions

View File

@@ -677,6 +677,12 @@ export const IssueCommentSchema = z.object({
body: z.string()
});
export const GetIssueSchema = z.object({
owner: z.string().describe("Repository owner (username or organization)"),
repo: z.string().describe("Repository name"),
issue_number: z.number().describe("Issue number")
});
// Export types
export type GitHubAuthor = z.infer<typeof GitHubAuthorSchema>;
export type GitHubFork = z.infer<typeof GitHubForkSchema>;