Skip to content
Merged
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
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -668,15 +668,6 @@ The following sets of tools are available (all are on by default):
- `title`: New title (string, optional)
- `type`: New issue type (string, optional)

- **write_label** - Write operations on repository labels.
- `color`: Label color as 6-character hex code without '#' prefix (e.g., 'f29513'). Required for 'create', optional for 'update'. (string, optional)
- `description`: Label description text. Optional for 'create' and 'update'. (string, optional)
- `method`: Operation to perform: 'create', 'update', or 'delete' (string, required)
- `name`: Label name - required for all operations (string, required)
- `new_name`: New name for the label (used only with 'update' method to rename) (string, optional)
- `owner`: Repository owner (username or organization name) (string, required)
- `repo`: Repository name (string, required)

</details>

<details>
Expand All @@ -688,12 +679,7 @@ The following sets of tools are available (all are on by default):
- `owner`: Repository owner (username or organization name) (string, required)
- `repo`: Repository name (string, required)

- **list_label** - List labels from a repository or an issue
- `issue_number`: Issue number - if provided, lists labels on the specific issue (number, optional)
- `owner`: Repository owner (username or organization name) - required for all operations (string, required)
- `repo`: Repository name - required for all operations (string, required)

- **write_label** - Write operations on repository labels.
- **label_write** - Write operations on repository labels.
- `color`: Label color as 6-character hex code without '#' prefix (e.g., 'f29513'). Required for 'create', optional for 'update'. (string, optional)
- `description`: Label description text. Optional for 'create' and 'update'. (string, optional)
- `method`: Operation to perform: 'create', 'update', or 'delete' (string, required)
Expand All @@ -702,6 +688,11 @@ The following sets of tools are available (all are on by default):
- `owner`: Repository owner (username or organization name) (string, required)
- `repo`: Repository name (string, required)

- **list_label** - List labels from a repository or an issue
- `issue_number`: Issue number - if provided, lists labels on the specific issue (number, optional)
- `owner`: Repository owner (username or organization name) - required for all operations (string, required)
- `repo`: Repository name - required for all operations (string, required)

</details>

<details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
],
"type": "object"
},
"name": "write_label"
"name": "label_write"
}
10 changes: 5 additions & 5 deletions pkg/github/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ func ListLabels(getGQLClient GetGQLClientFn, t translations.TranslationHelperFun
}
}

// WriteLabel handles create, update, and delete operations for GitHub labels
func WriteLabel(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
// LabelWrite handles create, update, and delete operations for GitHub labels
func LabelWrite(getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
return mcp.NewTool(
"write_label",
mcp.WithDescription(t("TOOL_WRITE_LABEL_DESCRIPTION", "Perform write operations on repository labels. To set labels on issues, use the 'update_issue' tool.")),
"label_write",
mcp.WithDescription(t("TOOL_LABEL_WRITE_DESCRIPTION", "Perform write operations on repository labels. To set labels on issues, use the 'update_issue' tool.")),
mcp.WithToolAnnotation(mcp.ToolAnnotation{
Title: t("TOOL_WRITE_LABEL_TITLE", "Write operations on repository labels."),
Title: t("TOOL_LABEL_WRITE_TITLE", "Write operations on repository labels."),
Comment on lines +246 to +248
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The translation keys have been updated from TOOL_WRITE_LABEL_* to TOOL_LABEL_WRITE_* but there's no evidence that the corresponding translation files have been updated. This could result in missing translations falling back to the default English text.

Copilot uses AI. Check for mistakes.

ReadOnlyHint: ToBoolPtr(false),
}),
mcp.WithString("method",
Expand Down
6 changes: 3 additions & 3 deletions pkg/github/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ func TestWriteLabel(t *testing.T) {

// Verify tool definition
mockClient := githubv4.NewClient(nil)
tool, _ := WriteLabel(stubGetGQLClientFn(mockClient), translations.NullTranslationHelper)
tool, _ := LabelWrite(stubGetGQLClientFn(mockClient), translations.NullTranslationHelper)
require.NoError(t, toolsnaps.Test(tool.Name, tool))

assert.Equal(t, "write_label", tool.Name)
assert.Equal(t, "label_write", tool.Name)
assert.NotEmpty(t, tool.Description)
assert.Contains(t, tool.InputSchema.Properties, "method")
assert.Contains(t, tool.InputSchema.Properties, "owner")
Expand Down Expand Up @@ -520,7 +520,7 @@ func TestWriteLabel(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
client := githubv4.NewClient(tc.mockedClient)
_, handler := WriteLabel(stubGetGQLClientFn(client), translations.NullTranslationHelper)
_, handler := LabelWrite(stubGetGQLClientFn(client), translations.NullTranslationHelper)

request := createMCPRequest(tc.requestArgs)
result, err := handler(context.Background(), request)
Expand Down
3 changes: 1 addition & 2 deletions pkg/github/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
toolsets.NewServerTool(AddSubIssue(getClient, t)),
toolsets.NewServerTool(RemoveSubIssue(getClient, t)),
toolsets.NewServerTool(ReprioritizeSubIssue(getClient, t)),
toolsets.NewServerTool(WriteLabel(getGQLClient, t)),
).AddPrompts(
toolsets.NewServerPrompt(AssignCodingAgentPrompt(t)),
toolsets.NewServerPrompt(IssueToFixWorkflowPrompt(t)),
Expand Down Expand Up @@ -335,7 +334,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
).
AddWriteTools(
// create or update
toolsets.NewServerTool(WriteLabel(getGQLClient, t)),
toolsets.NewServerTool(LabelWrite(getGQLClient, t)),
)
// Add toolsets to the group
tsg.AddToolset(contextTools)
Expand Down
Loading