Skip to content

Commit dd5ed52

Browse files
RossTarrantCopilotkerobbi
authored andcommitted
feat: Add tool for discussion comment write operations (#2427)
* Add discussion comment write operation tools Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address comments from Copilot review * Update includeReplies description to specify GitHub API maximum replies limit * Consolidate into single tool * add tests cases for checking param presence * Enhance validation on discussion comment operations * Enhance discussion_write tool description Co-authored-by: Roberto Nacu <kerobbi@github.com> * Remove redundant param Co-authored-by: Roberto Nacu <kerobbi@github.com> * Refactor tests * Fix failing build --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Roberto Nacu <kerobbi@github.com>
1 parent 4400f80 commit dd5ed52

6 files changed

Lines changed: 1495 additions & 38 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": true,
4+
"title": "Manage discussion comments"
5+
},
6+
"description": "Write operations for discussion comments.\nSupports adding top-level comments, replying to existing comments, updating comment content, deleting comments, and marking or unmarking comments as the answer.",
7+
"inputSchema": {
8+
"properties": {
9+
"body": {
10+
"description": "Comment content (required for 'add', 'reply', and 'update' methods)",
11+
"type": "string"
12+
},
13+
"commentNodeID": {
14+
"description": "The Node ID of the discussion comment (required for 'reply', 'update', 'delete', 'mark_answer', and 'unmark_answer' methods). For 'reply', this is the top-level comment to reply to; GitHub Discussions only support one level of nesting.",
15+
"type": "string"
16+
},
17+
"discussionNumber": {
18+
"description": "Discussion number (required for 'add' and 'reply' methods)",
19+
"type": "number"
20+
},
21+
"method": {
22+
"description": "Write operation to perform on a discussion comment.\nOptions are:\n- 'add' - adds a new top-level comment to a discussion.\n- 'reply' - replies to a top-level discussion comment (GitHub Discussions only support one level of nesting).\n- 'update' - updates an existing discussion comment.\n- 'delete' - deletes a discussion comment.\n- 'mark_answer' - marks a discussion comment as the answer (Q\u0026A only).\n- 'unmark_answer' - unmarks a discussion comment as the answer (Q\u0026A only).\n",
23+
"enum": [
24+
"add",
25+
"reply",
26+
"update",
27+
"delete",
28+
"mark_answer",
29+
"unmark_answer"
30+
],
31+
"type": "string"
32+
},
33+
"owner": {
34+
"description": "Repository owner (required for 'add' and 'reply' methods)",
35+
"type": "string"
36+
},
37+
"repo": {
38+
"description": "Repository name (required for 'add' and 'reply' methods)",
39+
"type": "string"
40+
}
41+
},
42+
"required": [
43+
"method"
44+
],
45+
"type": "object"
46+
},
47+
"name": "discussion_comment_write"
48+
}

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 (up to 100 replies per comment, which is the GitHub API maximum). Defaults to false.",
19+
"type": "boolean"
20+
},
1721
"owner": {
1822
"description": "Repository owner",
1923
"type": "string"

0 commit comments

Comments
 (0)