Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/github/__toolsnaps__/create_issue.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"annotations": {
"destructiveHint": false,
"destructiveHint": true,
"openWorldHint": true,
"title": "Create Issue"
},
Expand Down
1 change: 1 addition & 0 deletions pkg/github/__toolsnaps__/issue_write.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
}
},
"annotations": {
"destructiveHint": true,
"title": "Create or update issue."
},
"description": "Create a new or update an existing issue in a GitHub repository.",
Expand Down
5 changes: 3 additions & 2 deletions pkg/github/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,9 @@ func IssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool {
Name: "issue_write",
Description: t("TOOL_ISSUE_WRITE_DESCRIPTION", "Create a new or update an existing issue in a GitHub repository."),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_ISSUE_WRITE_USER_TITLE", "Create or update issue."),
ReadOnlyHint: false,
Title: t("TOOL_ISSUE_WRITE_USER_TITLE", "Create or update issue."),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(true),
},
Meta: mcp.Meta{
"ui": map[string]any{
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/issues_granular.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func GranularCreateIssue(t translations.TranslationHelperFunc) inventory.ServerT
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_CREATE_ISSUE_USER_TITLE", "Create Issue"),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(false),
DestructiveHint: jsonschema.Ptr(true),
OpenWorldHint: jsonschema.Ptr(true),
},
InputSchema: &jsonschema.Schema{
Expand Down
5 changes: 4 additions & 1 deletion pkg/github/issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,14 +1050,17 @@ func unmarshalIFC(t *testing.T, ifcLabel any) map[string]any {
return ifcMap
}

func Test_CreateIssue(t *testing.T) {
func Test_IssueWrite_Create(t *testing.T) {
// Verify tool definition once
serverTool := IssueWrite(translations.NullTranslationHelper)
tool := serverTool.Tool
require.NoError(t, toolsnaps.Test(tool.Name, tool))

assert.Equal(t, "issue_write", tool.Name)
assert.NotEmpty(t, tool.Description)
Comment thread
gokhanarkan marked this conversation as resolved.
require.NotNil(t, tool.Annotations)
require.NotNil(t, tool.Annotations.DestructiveHint)
assert.True(t, *tool.Annotations.DestructiveHint)
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "method")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "owner")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "repo")
Expand Down
Loading