get_discussion and get_discussion_comments accept calls with missing required parameters instead of returning a validation error
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- go
- Ambito
- api, backend-api-design
Direzione di ricerca
Inizia individuando gli handler get_discussion e get_discussion_comments e confronta la loro decodifica dei parametri con quella degli handler di scrittura di Discussion convalidati e aggiornati in PR #2718. Riproduci chiamate omettendo ciascun campo obbligatorio, quindi conferma che entrambi gli strumenti di lettura restituiscano un errore di validazione denominato per parametro mancante senza inviare una richiesta GraphQL.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 33.1k
- Fork
- 5k
- Merge medio
- 2g 1h
- PR unite (30g)
- 25
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/github-mcp-server
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
github/github-mcp-server#3235 ·
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
github/github-mcp-server#3042 · 2 commenti ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/github-mcp-server#3032 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
github/github-mcp-server#2803 · 1 commento ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
github/github-mcp-server#2661 · 1 commento ·
Tutte le issue di github/github-mcp-server
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Broadcast Documentation Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
kovidgoyal/kitty#10516 ·
-
CVE-2024-24786 CPE mismatch Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
cisagov/vulnrichment#337 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100