get_discussion and get_discussion_comments accept calls with missing required parameters instead of returning a validation error
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- go
- Domínio
- api, backend-api-design
Direção de pesquisa
Comece localizando os handlers get_discussion e get_discussion_comments e compare a decodificação dos parâmetros deles com a dos handlers de escrita de Discussion validados e atualizados no PR #2718. Reproduza chamadas omitindo cada campo obrigatório e, em seguida, confirme que ambas as ferramentas de leitura retornam um erro de validação nomeado por parâmetro ausente sem emitir uma requisição GraphQL.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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_discussionwith only{"repo": "myrepo", "discussionNumber": 1}(omittingowner). - Observe that the tool returns a GraphQL error like
"Could not resolve to a Repository"rather than a message indicatingowneris 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.
- Linguagem predominante
- Go
- Estrelas
- 33.1k
- Forks
- 5k
- Merge médio
- 2d 15h
- PRs com merge (30d)
- 27
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/github-mcp-server
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
github/github-mcp-server#3235 ·
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
github/github-mcp-server#3042 · 2 comentários ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/github-mcp-server#3032 · 1 reação ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
github/github-mcp-server#2803 · 1 comentário ·
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
github/github-mcp-server#2661 · 1 comentário ·
Todas as issues de github/github-mcp-server
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
-
enhancement needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
kind/cleanup
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
kubernetes-sigs/kueue#15947 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
sympozium-ai/sympozium#627 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100