Skip to content

Commit 6411325

Browse files
RossTarrantCopilot
andcommitted
Add discussion comment write operation tools
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4bded57 commit 6411325

10 files changed

Lines changed: 1556 additions & 38 deletions

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,18 @@ The following sets of tools are available:
730730

731731
<summary><picture><source media="(prefers-color-scheme: dark)" srcset="pkg/octicons/icons/comment-discussion-dark.png"><source media="(prefers-color-scheme: light)" srcset="pkg/octicons/icons/comment-discussion-light.png"><img src="pkg/octicons/icons/comment-discussion-light.png" width="20" height="20" alt="comment-discussion"></picture> Discussions</summary>
732732

733+
- **add_discussion_comment** - Add discussion comment
734+
- **Required OAuth Scopes**: `repo`
735+
- `body`: Comment content (string, required)
736+
- `discussionNumber`: Discussion Number (number, required)
737+
- `owner`: Repository owner (string, required)
738+
- `replyToCommentNodeID`: The Node ID of the comment to reply to. If provided, the comment will be posted as a reply. (string, optional)
739+
- `repo`: Repository name (string, required)
740+
741+
- **delete_discussion_comment** - Delete discussion comment
742+
- **Required OAuth Scopes**: `repo`
743+
- `commentNodeID`: The Node ID of the discussion comment to delete (string, required)
744+
733745
- **get_discussion** - Get discussion
734746
- **Required OAuth Scopes**: `repo`
735747
- `discussionNumber`: Discussion Number (number, required)
@@ -740,6 +752,7 @@ The following sets of tools are available:
740752
- **Required OAuth Scopes**: `repo`
741753
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
742754
- `discussionNumber`: Discussion Number (number, required)
755+
- `includeReplies`: When true, each top-level comment will include its replies nested within it. Defaults to false. (boolean, optional)
743756
- `owner`: Repository owner (string, required)
744757
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
745758
- `repo`: Repository name (string, required)
@@ -759,6 +772,16 @@ The following sets of tools are available:
759772
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
760773
- `repo`: Repository name. If not provided, discussions will be queried at the organisation level. (string, optional)
761774

775+
- **set_discussion_comment_answer** - Set discussion comment as answer
776+
- **Required OAuth Scopes**: `repo`
777+
- `commentNodeID`: The Node ID of the discussion comment to mark or unmark as the answer (string, required)
778+
- `isAnswer`: Whether the comment is the answer to the discussion (true to mark, false to unmark) (boolean, required)
779+
780+
- **update_discussion_comment** - Update discussion comment
781+
- **Required OAuth Scopes**: `repo`
782+
- `body`: The new contents of the comment (string, required)
783+
- `commentNodeID`: The Node ID of the discussion comment to update (string, required)
784+
762785
</details>
763786

764787
<details>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"annotations": {
3+
"title": "Add discussion comment"
4+
},
5+
"description": "Add a comment to a discussion",
6+
"inputSchema": {
7+
"properties": {
8+
"body": {
9+
"description": "Comment content",
10+
"type": "string"
11+
},
12+
"discussionNumber": {
13+
"description": "Discussion Number",
14+
"type": "number"
15+
},
16+
"owner": {
17+
"description": "Repository owner",
18+
"type": "string"
19+
},
20+
"replyToCommentNodeID": {
21+
"description": "The Node ID of the comment to reply to. If provided, the comment will be posted as a reply.",
22+
"type": "string"
23+
},
24+
"repo": {
25+
"description": "Repository name",
26+
"type": "string"
27+
}
28+
},
29+
"required": [
30+
"owner",
31+
"repo",
32+
"discussionNumber",
33+
"body"
34+
],
35+
"type": "object"
36+
},
37+
"name": "add_discussion_comment"
38+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"annotations": {
3+
"title": "Delete discussion comment"
4+
},
5+
"description": "Delete a comment on a discussion",
6+
"inputSchema": {
7+
"properties": {
8+
"commentNodeID": {
9+
"description": "The Node ID of the discussion comment to delete",
10+
"type": "string"
11+
}
12+
},
13+
"required": [
14+
"commentNodeID"
15+
],
16+
"type": "object"
17+
},
18+
"name": "delete_discussion_comment"
19+
}

pkg/github/__toolsnaps__/get_discussion_comments.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"description": "Discussion Number",
1515
"type": "number"
1616
},
17+
"includeReplies": {
18+
"description": "When true, each top-level comment will include its replies nested within it. Defaults to false.",
19+
"type": "boolean"
20+
},
1721
"owner": {
1822
"description": "Repository owner",
1923
"type": "string"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"annotations": {
3+
"title": "Set discussion comment as answer"
4+
},
5+
"description": "Marks or unmarks a given discussion comment as the answer to the discussion.",
6+
"inputSchema": {
7+
"properties": {
8+
"commentNodeID": {
9+
"description": "The Node ID of the discussion comment to mark or unmark as the answer",
10+
"type": "string"
11+
},
12+
"isAnswer": {
13+
"description": "Whether the comment is the answer to the discussion (true to mark, false to unmark)",
14+
"type": "boolean"
15+
}
16+
},
17+
"required": [
18+
"commentNodeID",
19+
"isAnswer"
20+
],
21+
"type": "object"
22+
},
23+
"name": "set_discussion_comment_answer"
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"annotations": {
3+
"title": "Update discussion comment"
4+
},
5+
"description": "Update a comment on a discussion",
6+
"inputSchema": {
7+
"properties": {
8+
"body": {
9+
"description": "The new contents of the comment",
10+
"type": "string"
11+
},
12+
"commentNodeID": {
13+
"description": "The Node ID of the discussion comment to update",
14+
"type": "string"
15+
}
16+
},
17+
"required": [
18+
"commentNodeID",
19+
"body"
20+
],
21+
"type": "object"
22+
},
23+
"name": "update_discussion_comment"
24+
}

0 commit comments

Comments
 (0)