fix(tools): list supported methods in unknown-method dispatch errors#2769
Open
syf2211 wants to merge 1 commit into
Open
fix(tools): list supported methods in unknown-method dispatch errors#2769syf2211 wants to merge 1 commit into
syf2211 wants to merge 1 commit into
Conversation
- Add methodEnum/unknownMethodError helpers in params.go - Use shared method slices for schema enums and runtime validation - Update actions, issues, pull_requests, projects, and ui_get tools - Require method param in pull_request_review_write before WeakDecode - Add regression tests for helper and pull_request_review_write errors Fixes github#2712
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
Improve consolidated method-dispatch MCP tools to return actionable errors when an unrecognized
methodis provided, matching the existinglabel_writebehavior.Motivation
Fixes #2712. Tools such as
pull_request_read,pull_request_review_write,issue_read,sub_issue_write,actions_*,projects_*, andui_getpreviously returned bareunknown method: <value>errors. Whenmethodwas omitted frompull_request_review_write, callers sawunknown method:with an empty value instead of a required-parameter error.Changes
methodEnum()andunknownMethodError()helpers inpkg/github/params.godefaultbranchesmethodinpull_request_review_writebeforeWeakDecoderoutingpull_request_review_writeerror pathssub_issue_writetoolsnap enumTests
go test ./pkg/github/... -count=1Result: PASS (0.161s)
Notes
main;issue_readretainsget_parentsupport.label_writealready had inline supported-method messaging and was left unchanged to keep scope minimal.main.