- Notifications
You must be signed in to change notification settings - Fork2.7k
adding labels tools#1193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
adding labels tools#1193
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds comprehensive GitHub Labels tools functionality to the GitHub MCP Server, enabling users to create, read, update, and delete repository labels through dedicated tools.
- Introduces a new "labels" toolset with three core functions: get_label, list_label, and write_label
- Adds extensive test coverage for all label operations including edge cases and error scenarios
- Updates documentation to include the new labels toolset in both README and remote server documentation
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
pkg/github/tools.go | Adds ToolsetLabels metadata and integrates label tools into the default toolset group |
pkg/github/labels.go | Implements the three main label tools with GraphQL operations for CRUD functionality |
pkg/github/labels_test.go | Comprehensive test suite covering all label operations and error cases |
pkg/github/toolsnaps/*.snap | Tool schema snapshots for the three label tools |
docs/remote-server.md | Documents the new labels toolset in the remote server table |
README.md | Updates tool documentation with labels section and individual tool descriptions |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
Description:"Discover GitHub MCP tools that can help achieve tasks by enabling additional sets of tools, you can control the enablement of any toolset to access its tools when this toolset is enabled.", | ||
} | ||
ToolsetLabels=ToolsetMetadata{ | ||
ID:"labels", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Inconsistent indentation detected. The field assignment uses tabs mixed with spaces, which should be aligned consistently with other struct fields in the same block.
ID:"labels", | |
ID:"labels", |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1,52 @@ | |||
{ | |||
"annotations": { | |||
"title":"Write operations on labels - create, update, delete", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The title in the snapshot differs from the title defined in the source code. The source uses 'Write operations on labels' but the snapshot shows 'Write operations on labels - create, update, delete'.
"title":"Write operations on labels - create, update, delete", | |
"title":"Write operations on labels", |
Copilot uses AI. Check for mistakes.
"title":"Write operations on labels - create, update, delete", | ||
"readOnlyHint":false | ||
}, | ||
"description":"Create, update, or delete repository labels in GitHub.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The description in the snapshot differs from the description defined in the source code. The source uses the translation key output while the snapshot shows a hardcoded description.
"description":"Create, update, or delete repository labels in GitHub.", | |
"description":"output", |
Copilot uses AI. Check for mistakes.
-`owner`: Repository owner (username or organization name) (string, required) | ||
-`repo`: Repository name (string, required) | ||
-**list_label** - Get Label from a repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The description 'Get Label from a repository.' is incorrect for list_label. It should be 'List labels from a repository or an issue' to match the actual functionality.
-**list_label** -Get Label from a repository. | |
-**list_label** -List labels from a repository or an issue. |
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading.Please reload this page.
This PR adds label management tools using a consolidated approach with GraphQL-only operations.
Summary
Following the tool consolidation pattern from#1172, this PR introduces three multi-functional label management tools:
get_label
- Retrieves a specific label by name from a repositorylist_label
- Lists labels from a repository OR an issue (usesissue_number
parameter to switch context)write_label
- Unified write operations withmethod
parameter:create
- Create a new label (requiresname
,color
)update
- Update existing label (requiresname
, at least one ofnew_name
/color
/description
)delete
- Delete a label (requiresname
)Design Philosophy
We're moving towardconsolidated, multi-functional tools that use method parameters to handle related operations, rather than creating separate tools for each action. This approach:
get
tools #1172's PR consolidation)Technical Details
All operations useGraphQL exclusively (
gqlClient
) for consistency and efficiency:repository.labels
andrepository.issue.labels
createLabel
,updateLabel
, anddeleteLabel
getRepositoryID()
andgetLabelID()
support the mutations