Describe the bug
When get_discussion or get_discussion_comments is called without one of the required parameters (owner, repo, or discussionNumber), the tool does not return a parameter-validation error. Instead it silently substitutes a zero value and issues a GraphQL request, which returns a confusing API-level error rather than a clear message identifying the missing field.
Affected version: current (tested against ghcr.io/github/github-mcp-server latest as of 2026-06)
Steps to reproduce
- Configure the MCP server normally.
- Call
get_discussion with only {"repo": "myrepo", "discussionNumber": 1} (omitting owner).
- Observe that the tool returns a GraphQL error like
"Could not resolve to a Repository" rather than a message indicating owner is required.
Repeat with get_discussion_comments and any missing required field.
Expected behavior
The tool should return a structured error immediately: "missing required parameter: owner" (or equivalent), consistent with how add_discussion_comment and the other discussion write tools behave when a required parameter is absent.
Actual behavior
The tool issues a GraphQL query with the missing field set to its zero value ("" for strings, 0 for numbers) and returns whichever API error results from that invalid query.
Additional context
The write handlers in the same file (add_discussion_comment, reply_to_discussion_comment, etc.) were updated in PR #2718 to use explicit parameter validation that returns named errors on missing input. The two read handlers were not included in that pass and still use the legacy decoding pattern.
Describe the bug
When
get_discussionorget_discussion_commentsis called without one of the required parameters (owner,repo, ordiscussionNumber), the tool does not return a parameter-validation error. Instead it silently substitutes a zero value and issues a GraphQL request, which returns a confusing API-level error rather than a clear message identifying the missing field.Affected version: current (tested against
ghcr.io/github/github-mcp-serverlatest as of 2026-06)Steps to reproduce
get_discussionwith only{"repo": "myrepo", "discussionNumber": 1}(omittingowner)."Could not resolve to a Repository"rather than a message indicatingowneris required.Repeat with
get_discussion_commentsand any missing required field.Expected behavior
The tool should return a structured error immediately:
"missing required parameter: owner"(or equivalent), consistent with howadd_discussion_commentand the other discussion write tools behave when a required parameter is absent.Actual behavior
The tool issues a GraphQL query with the missing field set to its zero value (
""for strings,0for numbers) and returns whichever API error results from that invalid query.Additional context
The write handlers in the same file (
add_discussion_comment,reply_to_discussion_comment, etc.) were updated in PR #2718 to use explicit parameter validation that returns named errors on missing input. The two read handlers were not included in that pass and still use the legacy decoding pattern.