mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 08:13:24 +02:00
feat: add issue management functionalities for github
- Implemented `listIssues`, `updateIssue`, and `addIssueComment` functions to manage GitHub issues. - Introduced corresponding schemas: `ListIssuesOptionsSchema`, `UpdateIssueOptionsSchema`, and `IssueCommentSchema`. - Updated server request handlers to support new functionalities. - Enhanced README with documentation for new features.
This commit is contained in:
@@ -358,6 +358,39 @@ export const CreateBranchSchema = RepoParamsSchema.extend({
|
||||
.describe("Optional: source branch to create from (defaults to the repository's default branch)")
|
||||
});
|
||||
|
||||
// Add these schema definitions for issue management
|
||||
|
||||
export const ListIssuesOptionsSchema = z.object({
|
||||
owner: z.string(),
|
||||
repo: z.string(),
|
||||
state: z.enum(['open', 'closed', 'all']).optional(),
|
||||
labels: z.array(z.string()).optional(),
|
||||
sort: z.enum(['created', 'updated', 'comments']).optional(),
|
||||
direction: z.enum(['asc', 'desc']).optional(),
|
||||
since: z.string().optional(), // ISO 8601 timestamp
|
||||
page: z.number().optional(),
|
||||
per_page: z.number().optional()
|
||||
});
|
||||
|
||||
export const UpdateIssueOptionsSchema = z.object({
|
||||
owner: z.string(),
|
||||
repo: z.string(),
|
||||
issue_number: z.number(),
|
||||
title: z.string().optional(),
|
||||
body: z.string().optional(),
|
||||
state: z.enum(['open', 'closed']).optional(),
|
||||
labels: z.array(z.string()).optional(),
|
||||
assignees: z.array(z.string()).optional(),
|
||||
milestone: z.number().optional()
|
||||
});
|
||||
|
||||
export const IssueCommentSchema = z.object({
|
||||
owner: z.string(),
|
||||
repo: z.string(),
|
||||
issue_number: z.number(),
|
||||
body: z.string()
|
||||
});
|
||||
|
||||
// Export types
|
||||
export type GitHubAuthor = z.infer<typeof GitHubAuthorSchema>;
|
||||
export type GitHubFork = z.infer<typeof GitHubForkSchema>;
|
||||
|
||||
Reference in New Issue
Block a user