Add optional rationale parameter to update_issue_type tool - #2458
Merged
Merged
Conversation
alondahari
force-pushed
the
alondahari/add-rationale-to-update-issue-type
branch
3 times, most recently
from
May 12, 2026 14:30
c82dcb5 to
3b57894
Compare
CZNetworks
approved these changes
May 12, 2026
Add an optional `rationale` string parameter (max 280 chars) to the
`update_issue_type` MCP tool. When provided, the type is sent as an
object `{"name": "...", "rationale": "..."}` to the REST API,
enabling agents to explain their classification decisions. When omitted,
existing behavior is preserved (type sent as a plain string).
This supports the agent rationale experiment for type mutations. The
parameter is always visible in the schema — the API gracefully ignores
the rationale when the server-side feature flag is disabled.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
alondahari
force-pushed
the
alondahari/add-rationale-to-update-issue-type
branch
from
May 12, 2026 14:35
3b57894 to
2ce2ced
Compare
omgitsads
previously approved these changes
May 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional rationale parameter to the update_issue_type granular MCP tool so agents can provide a short explanation when setting an issue’s type, while preserving the existing request shape when rationale is omitted.
Changes:
- Reworked
update_issue_typeto send either a stringtypefield (no rationale) or an objecttypefield with{value, rationale}(when rationale is present). - Expanded unit test coverage to validate both request payload shapes.
- Updated the tool schema snapshot to include the new optional
rationalefield (maxLength 280).
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issues_granular.go | Reimplements update_issue_type as a standalone tool and adds request-body branching to support sending rationale. |
| pkg/github/granular_tools_test.go | Adds table-driven tests to assert the outgoing PATCH body for type-only vs type-with-rationale. |
| pkg/github/toolsnaps/update_issue_type.snap | Updates the tool input schema snapshot to include the optional rationale parameter. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 2
| return nil, err | ||
| return utils.NewToolResultError(err.Error()), nil, nil | ||
| } | ||
| rationale, _ := OptionalParam[string](args, "rationale") |
Comment on lines
+393
to
+399
| var body any | ||
| if rationale != "" { | ||
| body = &issueTypeUpdateRequest{ | ||
| Type: issueTypeWithRationale{ | ||
| Value: issueType, | ||
| Rationale: rationale, | ||
| }, |
pachecocordovamoiseseduardo-byte
approved these changes
May 12, 2026
omgitsads
approved these changes
May 13, 2026
This was referenced May 21, 2026
This was referenced May 25, 2026
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
github-mcp-server 1.0.5 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * Add ifc label for list_issues tool by @gokhanarkan in github/github-mcp-server#2453 * Add ifc label for get_file_contents tool by @gokhanarkan in github/github-mcp-server#2454 * Add missing pagination on get_reviews by @RossTarrant in github/github-mcp-server#2367 * Add optional `rationale` parameter to `update_issue_type` tool by @alondahari in github/github-mcp-server#2458 * Add ifc label for search_issues tool by @gokhanarkan in github/github-mcp-server#2456 * Add ifc label for issue_read tool by @gokhanarkan in github/github-mcp-server#2457 * Add ifc label for search_repositories tool by @gokhanarkan in github/github-mcp-server#2459 * Return minimal code search results with text match snippets by @SamMorrowDrums in github/github-mcp-server#2476 * Replace ingress IFC reader list with private marker by @gokhanarkan in github/github-mcp-server#2478 * Document Copilot Spaces PAT requirements by @Bestra in github/github-mcp-server#2479 * Add tool to list repo collaborators by @JoannaaKL in github/github-mcp-server#2477 * Add tool for discussion comment write operations by @RossTarrant in github/github-mcp-server#2427 * Upgrade go-github to v 0.87 by @iulia-b in github/github-mcp-server#2452 ## New Contributors * @alondahari made their first contribution in github/github-mcp-server#2458 * @Bestra made their first contribution in github/github-mcp-server#2479 **Full Changelog**: https://github.com/github/github-mcp-server/compare/v1.0.4...v1.0.5</pre> <p>View the full release notes at <a href="https://github.com/github/github-mcp-server/releases/tag/v1.0.5">https://github.com/github/github-mcp-server/releases/tag/v1.0.5</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!3094
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
Adds an optional
rationalestring parameter (max 280 chars) to theupdate_issue_typeMCP tool, enabling agents to explain their classification decisions when setting an issue's type.Motivation
Per the decision update on github/plan-track-agentic-toolkit#57, we're adding
rationaledirectly to the upstream tool rather than as a remote-server-only override. This keeps the open-source tool schema in sync with the API contract while the API gracefully ignores the rationale when the server-side feature flag is disabled.Why a standalone tool instead of using
issueUpdateToolThe
issueUpdateToolhelper constrains handlers to returning a*github.IssueRequest, which only supportsType *string. Whenrationaleis provided, the REST API expects the type field as an object ({"value": "...", "rationale": "..."}) rather than a plain string. Since go-github'sIssueRequeststruct can't represent this object form, we need to build a custom request body and useclient.NewRequest/client.Dodirectly. Breaking out of the helper is the minimal change that enables the two serialization paths (string when no rationale, object when rationale is present) without modifying the shared helper or other tools that depend on it.Once the API changes are stable and go-github is updated to support the object form natively, we intend to migrate this tool back to the shared
issueUpdateToolhelper.Changes
pkg/github/issues_granular.go— RewroteGranularUpdateIssueTypeas a standalone tool (no longer usesissueUpdateToolhelper). Whenrationaleis provided, sends the type as an object{"value": "...", "rationale": "..."}via a raw PATCH request. When omitted, sends{"type": "..."}preserving existing behavior.pkg/github/granular_tools_test.go— Expanded test to table-driven covering both type-only and type-with-rationale cases.pkg/github/__toolsnaps__/update_issue_type.snap— Updated schema snapshot.Acceptance criteria
rationaleis always in the schema (no feature-flag gating in this repo)rationaleis omittedCloses github/plan-track-agentic-toolkit#57
/cc @margaretmz