Security alert list tools return inconsistent JSON response shapes
Maintainers usually reply within 4 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start with pkg/github/dependabot.go to see the object shape it builds (Alerts plus PageInfo), then compare with the marshalling in pkg/github/code_scanning.go and pkg/github/secret_scanning.go, which emit bare arrays. Update the two list tools to return the same {alerts, pageInfo} contract, adjusting any pagination metadata already available. Done when the existing tests in pkg/github/ for these three list tools pass with the new shape, adding a case asserting the top-level alerts property if none exists.
Written by the indexing model from the issue text.
Description
Describe the bug
The security alert list tools expose inconsistent JSON response shapes.
list_code_scanning_alerts and list_secret_scanning_alerts return their text payload as a bare JSON array:
[{"number":274,"rule":{"id":"py/unused-import"}}]
while list_dependabot_alerts returns an object:
{"alerts":[{"number":16}],"pageInfo":{"hasNextPage":false,"hasPreviousPage":false}}
This makes closely related security-list tools difficult to consume uniformly and can cause a client to interpret real findings as an empty result when it expects the Dependabot-style alerts property.
The implementation difference appears to be:
pkg/github/code_scanning.gomarshalsalertsdirectlypkg/github/secret_scanning.gomarshalsalertsdirectlypkg/github/dependabot.gobuilds an object containingAlertsandPageInfo
Affected version
v1.14.0
Steps to reproduce the behavior
- Call
list_code_scanning_alertsfor a repository with an open finding. - Observe that the text payload is a bare JSON array.
- Call
list_secret_scanning_alertsand observe the same shape. - Call
list_dependabot_alertsand observe{ "alerts": [...], "pageInfo": {...} }instead.
We reproduced this during a repository-wide Security & Quality audit. A real open CodeQL finding was present in the returned array but was initially missed by a consumer expecting the Dependabot response shape.
Expected vs actual behavior
Expected: the related security alert list tools expose a consistent top-level contract, preferably { "alerts": [...], "pageInfo": {...} } where pagination metadata applies.
Actual: Code Scanning and Secret Scanning return bare arrays, while Dependabot returns an object.
If the difference is intentional, documenting it explicitly would also help clients avoid incorrect assumptions.
Logs
No server error is produced; this is a response-shape inconsistency.
We currently normalize the two bare-array responses in a local compatibility gateway, but an upstream-consistent contract would remove the need for that workaround.
- Dominant language
- Go
- Stars
- 33.6k
- Forks
- 5.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/github-mcp-server
-
Add Zero-Docker quick start and clarify no‑Docker options in READMEPossibly taken @Flanxiyum001 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/github-mcp-server#3495 ·
Maintainers usually reply within 4 days
-
Integer parameters equal to 2^63 pass the range check in toInt and wrap to a negative numberPossibly taken @xiao115255 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
github/github-mcp-server#3489 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github/github-mcp-server#3475 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github/github-mcp-server#3450 ·
Maintainers usually reply within 4 days
-
get_job_logs with failed_only misses failed jobs after the first 30 jobs of a runPossibly taken @jayhemnani9910 claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
github/github-mcp-server#3428 ·
Maintainers usually reply within 4 days
All issues in github/github-mcp-server
Similar issues
-
Realtime: ASR EOU language tags leak into the LLM conversation (unintended reply-language switching)Possibly taken @nexxtmobile claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
effort:high model:sonnet phase:3 type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OffchainLabs/nitro#4771 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
BurntSushi/toml#530 ·