fix(issues): accept native integer types for issue_number parameters#2808
Open
syf2211 wants to merge 1 commit into
Open
fix(issues): accept native integer types for issue_number parameters#2808syf2211 wants to merge 1 commit into
syf2211 wants to merge 1 commit into
Conversation
Extend RequiredInt/toInt coercion to handle int, int64, and json.Number in addition to float64 and numeric strings. Some MCP clients (including mcpcurl integer flags) pass native Go integer types that were previously rejected with 'expected number, got int'. Also add missing deprecated aliases for the issues consolidation rename: get_issue -> issue_read and update_issue -> issue_write. Fixes github#2807
|
Nice fix, this addresses the native One thing I’d consider tightening before merge: the new numeric path accepts It might also be useful to add regression coverage for all affected issue tools: |
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
Extend
RequiredInt/toIntcoercion to accept native Go integer types (int,int64, etc.) andjson.Number, not onlyfloat64and numeric strings. Also restore missing deprecated aliases for the issues consolidation rename.Motivation
Fixes #2807. Some MCP clients (including mcpcurl when schema fields use
integer, and other providers that construct argument maps programmatically) passissue_numberas a native integer.RequiredIntpreviously rejected these withexpected number, got intbefore any GitHub API call was made.Additionally,
get_issueandupdate_issuewere renamed toissue_readandissue_writein #1211 but aliases were never added toDeprecatedToolAliases, breaking users still referencing the old tool names.Changes
numericToFloat64helper and routetoInt/toInt64through itget_issue→issue_read,update_issue→issue_writeint/int64inRequiredIntandadd_issue_commentTests
All tests pass.
Notes
params.gobenefits all tools usingRequiredInt, not only issue tools