Skip to content

Commit de10195

Browse files
committed
add toolsnaps
1 parent f18e296 commit de10195

File tree

5 files changed

+159
-0
lines changed

5 files changed

+159
-0
lines changed
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. Note: This is NOT the same as the 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. Note: This is NOT the same as the 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. Note: This is NOT the same as the 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+
}

pkg/github/issues_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,7 @@ func Test_AddSubIssue(t *testing.T) {
16401640
// Verify tool definition once
16411641
mockClient := github.NewClient(nil)
16421642
tool, _ := AddSubIssue(stubGetClientFn(mockClient), translations.NullTranslationHelper)
1643+
require.NoError(t, toolsnaps.Test(tool.Name, tool))
16431644

16441645
assert.Equal(t, "add_sub_issue", tool.Name)
16451646
assert.NotEmpty(t, tool.Description)
@@ -1875,6 +1876,7 @@ func Test_ListSubIssues(t *testing.T) {
18751876
// Verify tool definition once
18761877
mockClient := github.NewClient(nil)
18771878
tool, _ := ListSubIssues(stubGetClientFn(mockClient), translations.NullTranslationHelper)
1879+
require.NoError(t, toolsnaps.Test(tool.Name, tool))
18781880

18791881
assert.Equal(t, "list_sub_issues", tool.Name)
18801882
assert.NotEmpty(t, tool.Description)
@@ -2114,6 +2116,7 @@ func Test_RemoveSubIssue(t *testing.T) {
21142116
// Verify tool definition once
21152117
mockClient := github.NewClient(nil)
21162118
tool, _ := RemoveSubIssue(stubGetClientFn(mockClient), translations.NullTranslationHelper)
2119+
require.NoError(t, toolsnaps.Test(tool.Name, tool))
21172120

21182121
assert.Equal(t, "remove_sub_issue", tool.Name)
21192122
assert.NotEmpty(t, tool.Description)
@@ -2329,6 +2332,7 @@ func Test_ReprioritizeSubIssue(t *testing.T) {
23292332
// Verify tool definition once
23302333
mockClient := github.NewClient(nil)
23312334
tool, _ := ReprioritizeSubIssue(stubGetClientFn(mockClient), translations.NullTranslationHelper)
2335+
require.NoError(t, toolsnaps.Test(tool.Name, tool))
23322336

23332337
assert.Equal(t, "reprioritize_sub_issue", tool.Name)
23342338
assert.NotEmpty(t, tool.Description)

0 commit comments

Comments
 (0)