Add granular tool to set issue field values#2338
Merged
SamMorrowDrums merged 3 commits intomainfrom Apr 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new granular Issues tool for setting organization-level custom issue field values via GitHub’s GraphQL API.
Changes:
- Registers a new granular tool (
set_issue_fields) in the global tool inventory. - Implements the tool in
issues_granular.go, including GraphQL mutation input modeling and request parsing. - Adds tool snapshot coverage and unit tests for the new tool.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/tools.go | Registers GranularSetIssueFields in AllTools. |
| pkg/github/issues_granular.go | Implements the set_issue_fields tool, schema, argument parsing, and GraphQL mutation call. |
| pkg/github/granular_tools_test.go | Adds tool snap registration + unit tests for set_issue_fields. |
| pkg/github/toolsnaps/set_issue_fields.snap | Introduces the tool schema snapshot for set_issue_fields. |
Copilot's findings
Comments suppressed due to low confidence (1)
pkg/github/issues_granular.go:797
- The GraphQL mutation response struct includes IssueFieldValues with a fragment tagged on the nested Field property, and the result isn’t used anywhere. This adds query complexity and risks schema/selection-set mismatches (it’s also hard-coded to IssueFieldDateValue even though the tool supports multiple field types). Consider removing IssueFieldValues from the mutation selection entirely, or model/select it correctly for all supported value types if you actually need it.
var mutation struct {
SetIssueFieldValue struct {
Issue struct {
ID githubv4.ID
Number githubv4.Int
URL githubv4.String
}
IssueFieldValues []struct {
Field struct {
Name string
} `graphql:"... on IssueFieldDateValue"`
}
} `graphql:"setIssueFieldValue(input: $input)"`
- Files reviewed: 4/4 changed files
- Comments generated: 3
13 tasks
* Initial plan * Enforce exactly one value key per field in set_issue_fields and add tests Address review feedback: - Change validation to count value keys and reject when multiple are provided (e.g., text_value + number_value, or text_value + delete). - Add unit tests for multiple value keys and value + delete scenarios. - Run generate-docs (no doc changes needed; README was already current). Agent-Logs-Url: https://github.com/github/github-mcp-server/sessions/7e89edb3-5315-42dd-bfa1-6c962f1ba137 Co-authored-by: mattdholloway <918573+mattdholloway@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mattdholloway <918573+mattdholloway@users.noreply.github.com>
SamMorrowDrums
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds a new granular tool for setting custom issue field values on GitHub issues via GraphQL. The tool supports updating, creating, and deleting organization-level custom fields (text, number, date, or single select) for issues. It includes robust input validation, schema definition, and comprehensive tests to ensure correct behavior and error handling.
Why
Closes https://github.com/github/copilot-mcp-core/issues/1544
What changed
New Feature: Set Issue Fields Tool
set_issue_fieldstool that allows setting, updating, or deleting organization-level custom fields (text, number, date, or single select) on GitHub issues via GraphQL. The tool validates input, constructs the appropriate mutation, and returns minimal response data.MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs