Skip to content

Commit 05021de

Browse files
committed
feat(labels): add label CRUD tools and list_labels
1 parent cc5aec0 commit 05021de

File tree

9 files changed

+770
-8
lines changed

9 files changed

+770
-8
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,31 @@ The following sets of tools are available:
849849
- `owner`: Repository owner (username or organization name) (string, required)
850850
- `repo`: Repository name (string, required)
851851

852-
- **label_write** - Write operations on repository labels.
852+
- **list_labels** - List labels from a repository
853+
- `owner`: Repository owner (username or organization name) - required for all operations (string, required)
854+
- `repo`: Repository name - required for all operations (string, required)
855+
856+
- **create_label** - Create a label in a repository.
857+
- `color`: Label color as 6-character hex code without '#' prefix (e.g., 'f29513'). (string, required)
858+
- `description`: Label description text (optional). (string, optional)
859+
- `name`: Label name. (string, required)
860+
- `owner`: Repository owner (username or organization name) (string, required)
861+
- `repo`: Repository name (string, required)
862+
863+
- **update_label** - Update a label in a repository.
864+
- `color`: Label color as 6-character hex code without '#' prefix (optional). (string, optional)
865+
- `description`: Label description text (optional). (string, optional)
866+
- `name`: Label name to update. (string, required)
867+
- `new_name`: New name for the label (optional). (string, optional)
868+
- `owner`: Repository owner (username or organization name) (string, required)
869+
- `repo`: Repository name (string, required)
870+
871+
- **delete_label** - Delete a label from a repository.
872+
- `name`: Label name to delete. (string, required)
873+
- `owner`: Repository owner (username or organization name) (string, required)
874+
- `repo`: Repository name (string, required)
875+
876+
- **label_write** - Perform write operations on repository labels (advanced; supports create/update/delete via `method`).
853877
- `color`: Label color as 6-character hex code without '#' prefix (e.g., 'f29513'). Required for 'create', optional for 'update'. (string, optional)
854878
- `description`: Label description text. Optional for 'create' and 'update'. (string, optional)
855879
- `method`: Operation to perform: 'create', 'update', or 'delete' (string, required)
@@ -858,10 +882,6 @@ The following sets of tools are available:
858882
- `owner`: Repository owner (username or organization name) (string, required)
859883
- `repo`: Repository name (string, required)
860884

861-
- **list_label** - List labels from a repository
862-
- `owner`: Repository owner (username or organization name) - required for all operations (string, required)
863-
- `repo`: Repository name - required for all operations (string, required)
864-
865885
</details>
866886

867887
<details>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"annotations": {
3+
"title": "Create a label in a repository."
4+
},
5+
"description": "Create a label in a repository.",
6+
"inputSchema": {
7+
"type": "object",
8+
"properties": {
9+
"color": {
10+
"type": "string",
11+
"description": "Label color as 6-character hex code without '#' prefix (e.g., 'f29513')."
12+
},
13+
"description": {
14+
"type": "string",
15+
"description": "Label description text (optional)."
16+
},
17+
"name": {
18+
"type": "string",
19+
"description": "Label name."
20+
},
21+
"owner": {
22+
"type": "string",
23+
"description": "Repository owner (username or organization name)"
24+
},
25+
"repo": {
26+
"type": "string",
27+
"description": "Repository name"
28+
}
29+
},
30+
"required": [
31+
"owner",
32+
"repo",
33+
"name",
34+
"color"
35+
]
36+
},
37+
"name": "create_label"
38+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"annotations": {
3+
"destructiveHint": true,
4+
"title": "Delete a label from a repository."
5+
},
6+
"description": "Delete a label from a repository.",
7+
"inputSchema": {
8+
"type": "object",
9+
"properties": {
10+
"name": {
11+
"type": "string",
12+
"description": "Label name to delete."
13+
},
14+
"owner": {
15+
"type": "string",
16+
"description": "Repository owner (username or organization name)"
17+
},
18+
"repo": {
19+
"type": "string",
20+
"description": "Repository name"
21+
}
22+
},
23+
"required": [
24+
"owner",
25+
"repo",
26+
"name"
27+
]
28+
},
29+
"name": "delete_label"
30+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"annotations": {
3+
"readOnlyHint": true,
4+
"title": "List labels from a repository."
5+
},
6+
"description": "List labels from a repository",
7+
"inputSchema": {
8+
"type": "object",
9+
"properties": {
10+
"owner": {
11+
"type": "string",
12+
"description": "Repository owner (username or organization name) - required for all operations"
13+
},
14+
"repo": {
15+
"type": "string",
16+
"description": "Repository name - required for all operations"
17+
}
18+
},
19+
"required": [
20+
"owner",
21+
"repo"
22+
]
23+
},
24+
"name": "list_labels"
25+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"annotations": {
3+
"title": "Update a label in a repository."
4+
},
5+
"description": "Update a label in a repository.",
6+
"inputSchema": {
7+
"type": "object",
8+
"properties": {
9+
"color": {
10+
"type": "string",
11+
"description": "Label color as 6-character hex code without '#' prefix (optional)."
12+
},
13+
"description": {
14+
"type": "string",
15+
"description": "Label description text (optional)."
16+
},
17+
"name": {
18+
"type": "string",
19+
"description": "Label name to update."
20+
},
21+
"new_name": {
22+
"type": "string",
23+
"description": "New name for the label (optional)."
24+
},
25+
"owner": {
26+
"type": "string",
27+
"description": "Repository owner (username or organization name)"
28+
},
29+
"repo": {
30+
"type": "string",
31+
"description": "Repository name"
32+
}
33+
},
34+
"required": [
35+
"owner",
36+
"repo",
37+
"name"
38+
]
39+
},
40+
"name": "update_label"
41+
}

pkg/github/deprecated_tool_aliases.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ var DeprecatedToolAliases = map[string]string{
2828
"rerun_failed_jobs": "actions_run_trigger",
2929
"cancel_workflow_run": "actions_run_trigger",
3030
"delete_workflow_run_logs": "actions_run_trigger",
31+
32+
// Labels tools naming consistency
33+
"list_label": "list_labels",
3134
}

0 commit comments

Comments
 (0)