fix(issues): accept native integer types for issue_number parameters#2808
fix(issues): accept native integer types for issue_number parameters#2808syf2211 wants to merge 1 commit into
Conversation
|
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: |
|
Thanks @e345ee — addressed in d15c2fb:
|
Address review feedback on github#2808: - Handle int/int64/uint/json.Number without float64 round-trip - Add RequiredBigInt regression tests for large int64 values - Add issue_read/issue_write/add_issue_comment tests for int issue_number - Assert invalid issue_number fails before API calls on write tools
Rebase github#2808 onto upstream/main after hierarchy enrichment landed. Preserve int/int64/json.Number coercion without float64 round-trip and add regression tests for issue_read, issue_write, and add_issue_comment. Fixes github#2807
d15c2fb to
505c6ec
Compare
|
Rebased onto latest |
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