Repository navigation
fix: accept the swift ecosystem in list_global_security_advisories - #3937
Merged
SamMorrowDrums merged 1 commit intoNov 24, 2026
Merged
Conversation
The GitHub Advisory Database has a Swift ecosystem and the REST API accepts ecosystem=swift, but the tool's ecosystem enum left it out. The server validates arguments against that enum, so every call with ecosystem "swift" failed with a validation error before reaching the API. Add "swift" to the enum and refresh the tool snapshot.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The Swift ecosystem support is covered by the enum update, an MCP regression test confirming API reachability, and the refreshed schema snapshot, with no active review issues.
No open issues 🎉
What changed in this PR
This pull request updates list_global_security_advisories to accept Swift as a valid ecosystem, allowing Swift advisory requests to pass schema validation and reach GitHub's REST API.
Changes:
- Added
swiftto the ecosystem enum. - Added an MCP-level regression test verifying Swift reaches the API.
- Refreshed the corresponding tool schema snapshot.
| File | Description |
|---|---|
| pkg/github/security_advisories.go | Adds swift as an accepted ecosystem value. |
| pkg/github/security_advisories_test.go | Verifies Swift requests pass MCP schema validation and reach the API. |
| pkg/github/__toolsnaps__/list_global_security_advisories.snap | Records the updated ecosystem enum in the tool schema snapshot. |
Review effort: Lite (adaptive)
SamMorrowDrums
approved these changes
Nov 24, 2026
Collaborator
|
Thank you! |
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
list_global_security_advisoriesnow acceptsecosystem: "swift". The GitHub Advisory Database has a Swift ecosystem and the REST API accepts it, but the tool's enum left it out, so every Swift request was rejected by schema validation before reaching the API.Why
The ecosystem enum lists 12 values ending at
rust. The REST endpoint's own error message lists 13:rubygems, npm, pip, maven, nuget, composer, go, rust, erlang, actions, pub, other, swift. The server validates arguments against the tool schema, so:and clients that build forms or prompts from the schema never offer Swift.
GET /advisories?ecosystem=swiftreturns Swift advisories (for exampleGHSA-86wm-r4c5-2rc9).No upstream issue is associated with this fix. Reproduced on
mainat 9a72d8d.flowchart TD A[list_global_security_advisories with ecosystem swift] --> B{Schema validation} B -->|Before| C[Rejected, swift not in enum] B -->|After| D[Swift advisories returned]What changed
pkg/github/security_advisories.go: add"swift"to theecosystemenum.pkg/github/__toolsnaps__/list_global_security_advisories.snap: refreshed withUPDATE_TOOLSNAPS=true.pkg/github/security_advisories_test.go:Test_ListGlobalSecurityAdvisories_SwiftEcosystemcalls the tool through an MCP server and client (so schema validation runs) and checks thatecosystem=swiftreaches the API.Narrated recording in the MCP Inspector, before then after (sound on). Server run with
--read-only --toolsets=repos,security_advisories:evidence.mp4
Edge cases and unchanged behaviour checked (in the running server through the Inspector, as shown in the video):
ecosystem: gostill returns Go advisories (unchanged)ecosystem: swiftwithseverity: criticalreturns critical Swift advisories (edge case)ecosystem: swiftlyis still rejected by validation (unchanged; the message now lists swift)MCP impact
One value added to the
ecosystemenum oflist_global_security_advisories.Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lintgofmt -s -l pkg/githubclean; golangci-lint v2.14.0 (the pinned version) on./pkg/github/...: 0 issues../script/testgo test ./pkg/github/andgo test ./pkg/skills/catalog -run TestCatalogToolRequirementsAreRegisteredpass. The new test fails onmain(the call returns the validation error above) and passes with the fix.script/generate-docsproduced no README change. I did not run the whole repository suite.Docs
Skills
security-alert-triagementions the tool but not its ecosystem values; no change needed.AI assistance (Claude Code) was used to find the bug, write the fix and test, and record the video.
🤖 Generated with Claude Code