Skip to content

Commit 60a5391

Browse files
martinnormarkLuluBeatsontommaso-moro
authored
Add tools for sub-issue endpoint (#470)
* Create 'add sub-issue' tool * Fix hardcoded API host * Create 'list sub-issues' tool * Create 'remove sub-issue' tool * Fix Test_GetIssue mock data - add missing User field The assertion was already checking User.Login but the mock was incomplete * Create 'reprioritize sub-issue' tool * fixes * use go github pck to add sub-issues * Update to use go github package * update description * update to use go github v73 * lint, docs * refactor: tests to use go-github-mock * add toolsnaps * make RemoveSubIssue use NewGitHubAPIErrorResponse, update docstring * Always include SHA in get_file_contents responses (#676) * fix: Add SHA to get_file_contents while preserving MCP behavior (#595) Enhance get_file_contents to include SHA information without changing the existing MCP server response format. Changes: - Add Contents API call to retrieve SHA before fetching raw content - Include SHA in resourceURI (repo://owner/repo/sha/{SHA}/contents/path) - Add SHA to success messages - Update tests to verify SHA inclusion - Maintain original behavior: text files return raw text, binaries return base64 This preserves backward compatibility while providing SHA information for better file versioning support. Closes #595 * fix: Improve error handling for Contents API response Ensure response body is properly closed even when an error occurs by moving the defer statement before the error check. This prevents potential resource leaks when the Contents API returns an error with a non-nil response. Changes: - Move defer respContents.Body.Close() before error checking - Rename errContents to err for consistency - Add nil check for respContents before attempting to close body This follows Go best practices for handling HTTP responses and prevents potential goroutine/memory leaks. * revert changes to resource URI * use GraphQL API to get file SHA * refactor: mock GQL client instead of getFileSHA function to follow conventions * lint * revert GraphQL --------- Co-authored-by: LuluBeatson <lulubeatson@github.com> * Reorganize README, add dedicated install guides, include policies and governance info for the github server (#695) * Refactor README and add host installation guides, governance docs - Reorganized README for clarity and navigation - Added dedicated installation guides for Claude, Cursor, Windsurf, JetBrains, and more - Clarified contribution guidelines and approval criteria - Added policies and governance documentation * Update README.md * Update README with configuration section for remote GitHub MCP Server * Update MCP access policy description in README Removing coding agent from the policy note, as the GitHub server is unaffected by this policy * Update configuration steps for GitHub Copilot in JetBrains IDEs... ...to reflect changes in accessing settings and configuring MCP. * Update install-other-copilot-ides.md * Update Eclipse MCP support version and configuration steps... ...for GitHub Copilot plugin in installation guide. * Update docs/installation-guides/install-cursor.md * Update docs/installation-guides/install-windsurf.md * Apply suggestion from @tonytrg * Apply suggestion from @tonytrg * Apply suggestion from @tonytrg * Apply suggestion from @tonytrg * Apply suggestion from @tonytrg * Apply suggestion from @tonytrg * Apply suggestion from @tonytrg --------- Co-authored-by: Tony Truong <tonytrg@github.com> * fix: shorten long tool name for adding pr review comments (#697) * shorten tool name * update function name to match tool name * adjust wording of descriptions * Update installation guide for GitHub MCP Server (#699) * Update installation guide for GitHub MCP Server Removed reference to GitHub.com in the installation guide. The GitHub server is available to Coding Agent by default, without installation needed. * Rename section to 'Install in Other MCP Hosts' Updating title for consistency and adding a link to the "other Copilot IDEs" install guide. * Revise installation guide for Cursor MCP setup Updated installation guide for Cursor with steps clarified, remote server installation, and one-click install deeplinks to open Cursor and add the github server to the config file. * fix: make mcpcurl support "integer" type (#688) - FYI:https://json-schema.org/understanding-json-schema/reference/numeric#integer * Added installation instructions for mcpcurl (#719) * Added installation instructions for mcpcurl * Update cmd/mcpcurl/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add pagination support to GraphQL-based tools (#683) * initial pagination for `ListDiscussions` * redo category id var cast * add GraphQL pagination support for discussion comments and categories * remove pageinfo returns * fix out ref for linter * update docs * move to unified pagination for consensus on params * update docs * refactor pagination handling * update docs * linter fix * conv rest to gql params for safe lint * add nolint * add error handling for perPage value in ToGraphQLParams * refactor pagination error handling * unified params for rest andn graphql and rennamed to be uniform for golang * add 'after' for pagination * update docs * Update pkg/github/discussions.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update pkg/github/discussions.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update pkg/github/discussions_test.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * update default page size const * reduce default pagination size from 100 to 30 in discussion tests * update pagination for reverse and total * update pagination to remove from discussions * updated README * improve the `ToGraphQLParams` function --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * shorten param descriptions * fix: resp nil check in error handling in RemoveSubIssue function --------- Co-authored-by: LuluBeatson <lulubeatson@github.com> Co-authored-by: tommaso-moro <tommaso-moro@github.com>
1 parent 7ccc6b6 commit 60a5391

File tree

8 files changed

+1562
-0
lines changed

8 files changed

+1562
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,13 @@ The following sets of tools are available (all are on by default):
478478
- `owner`: Repository owner (string, required)
479479
- `repo`: Repository name (string, required)
480480

481+
- **add_sub_issue** - Add sub-issue
482+
- `issue_number`: The number of the parent issue (number, required)
483+
- `owner`: Repository owner (string, required)
484+
- `replace_parent`: When true, replaces the sub-issue's current parent issue (boolean, optional)
485+
- `repo`: Repository name (string, required)
486+
- `sub_issue_id`: The ID of the sub-issue to add. ID is not the same as issue number (number, required)
487+
481488
- **assign_copilot_to_issue** - Assign Copilot to issue
482489
- `issueNumber`: Issue number (number, required)
483490
- `owner`: Repository owner (string, required)
@@ -515,6 +522,27 @@ The following sets of tools are available (all are on by default):
515522
- `sort`: Sort order (string, optional)
516523
- `state`: Filter by state (string, optional)
517524

525+
- **list_sub_issues** - List sub-issues
526+
- `issue_number`: Issue number (number, required)
527+
- `owner`: Repository owner (string, required)
528+
- `page`: Page number for pagination (default: 1) (number, optional)
529+
- `per_page`: Number of results per page (max 100, default: 30) (number, optional)
530+
- `repo`: Repository name (string, required)
531+
532+
- **remove_sub_issue** - Remove sub-issue
533+
- `issue_number`: The number of the parent issue (number, required)
534+
- `owner`: Repository owner (string, required)
535+
- `repo`: Repository name (string, required)
536+
- `sub_issue_id`: The ID of the sub-issue to remove. ID is not the same as issue number (number, required)
537+
538+
- **reprioritize_sub_issue** - Reprioritize sub-issue
539+
- `after_id`: The ID of the sub-issue to be prioritized after (either after_id OR before_id should be specified) (number, optional)
540+
- `before_id`: The ID of the sub-issue to be prioritized before (either after_id OR before_id should be specified) (number, optional)
541+
- `issue_number`: The number of the parent issue (number, required)
542+
- `owner`: Repository owner (string, required)
543+
- `repo`: Repository name (string, required)
544+
- `sub_issue_id`: The ID of the sub-issue to reprioritize. ID is not the same as issue number (number, required)
545+
518546
- **search_issues** - Search issues
519547
- `order`: Sort order (string, optional)
520548
- `owner`: Optional repository owner. If provided with repo, only notifications for this repository are listed. (string, optional)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"annotations": {
3+
"title": "Add sub-issue",
4+
"readOnlyHint": false
5+
},
6+
"description": "Add a sub-issue to a parent issue in a GitHub repository.",
7+
"inputSchema": {
8+
"properties": {
9+
"issue_number": {
10+
"description": "The number of the parent issue",
11+
"type": "number"
12+
},
13+
"owner": {
14+
"description": "Repository owner",
15+
"type": "string"
16+
},
17+
"replace_parent": {
18+
"description": "When true, replaces the sub-issue's current parent issue",
19+
"type": "boolean"
20+
},
21+
"repo": {
22+
"description": "Repository name",
23+
"type": "string"
24+
},
25+
"sub_issue_id": {
26+
"description": "The ID of the sub-issue to add. ID is not the same as issue number",
27+
"type": "number"
28+
}
29+
},
30+
"required": [
31+
"owner",
32+
"repo",
33+
"issue_number",
34+
"sub_issue_id"
35+
],
36+
"type": "object"
37+
},
38+
"name": "add_sub_issue"
39+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"annotations": {
3+
"title": "List sub-issues",
4+
"readOnlyHint": true
5+
},
6+
"description": "List sub-issues for a specific issue in a GitHub repository.",
7+
"inputSchema": {
8+
"properties": {
9+
"issue_number": {
10+
"description": "Issue number",
11+
"type": "number"
12+
},
13+
"owner": {
14+
"description": "Repository owner",
15+
"type": "string"
16+
},
17+
"page": {
18+
"description": "Page number for pagination (default: 1)",
19+
"type": "number"
20+
},
21+
"per_page": {
22+
"description": "Number of results per page (max 100, default: 30)",
23+
"type": "number"
24+
},
25+
"repo": {
26+
"description": "Repository name",
27+
"type": "string"
28+
}
29+
},
30+
"required": [
31+
"owner",
32+
"repo",
33+
"issue_number"
34+
],
35+
"type": "object"
36+
},
37+
"name": "list_sub_issues"
38+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"annotations": {
3+
"title": "Remove sub-issue",
4+
"readOnlyHint": false
5+
},
6+
"description": "Remove a sub-issue from a parent issue in a GitHub repository.",
7+
"inputSchema": {
8+
"properties": {
9+
"issue_number": {
10+
"description": "The number of the parent issue",
11+
"type": "number"
12+
},
13+
"owner": {
14+
"description": "Repository owner",
15+
"type": "string"
16+
},
17+
"repo": {
18+
"description": "Repository name",
19+
"type": "string"
20+
},
21+
"sub_issue_id": {
22+
"description": "The ID of the sub-issue to remove. ID is not the same as issue number",
23+
"type": "number"
24+
}
25+
},
26+
"required": [
27+
"owner",
28+
"repo",
29+
"issue_number",
30+
"sub_issue_id"
31+
],
32+
"type": "object"
33+
},
34+
"name": "remove_sub_issue"
35+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"annotations": {
3+
"title": "Reprioritize sub-issue",
4+
"readOnlyHint": false
5+
},
6+
"description": "Reprioritize a sub-issue to a different position in the parent issue's sub-issue list.",
7+
"inputSchema": {
8+
"properties": {
9+
"after_id": {
10+
"description": "The ID of the sub-issue to be prioritized after (either after_id OR before_id should be specified)",
11+
"type": "number"
12+
},
13+
"before_id": {
14+
"description": "The ID of the sub-issue to be prioritized before (either after_id OR before_id should be specified)",
15+
"type": "number"
16+
},
17+
"issue_number": {
18+
"description": "The number of the parent issue",
19+
"type": "number"
20+
},
21+
"owner": {
22+
"description": "Repository owner",
23+
"type": "string"
24+
},
25+
"repo": {
26+
"description": "Repository name",
27+
"type": "string"
28+
},
29+
"sub_issue_id": {
30+
"description": "The ID of the sub-issue to reprioritize. ID is not the same as issue number",
31+
"type": "number"
32+
}
33+
},
34+
"required": [
35+
"owner",
36+
"repo",
37+
"issue_number",
38+
"sub_issue_id"
39+
],
40+
"type": "object"
41+
},
42+
"name": "reprioritize_sub_issue"
43+
}

0 commit comments

Comments
 (0)