Add optional rationale parameter to update_issue_type tool#2458
Draft
alondahari wants to merge 1 commit into
Draft
Add optional rationale parameter to update_issue_type tool#2458alondahari wants to merge 1 commit into
rationale parameter to update_issue_type tool#2458alondahari wants to merge 1 commit into
Conversation
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>
3b57894 to
2ce2ced
Compare
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