feat: implement cursor pagination for dependabot alerts#2651
Conversation
…lated documentation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates the list_dependabot_alerts tool to use cursor-based pagination and to surface pagination metadata (next cursor) in the tool response.
Changes:
- Switched
list_dependabot_alertsfrom page-based pagination (page) to cursor pagination (after). - Updated the tool response format to wrap alerts with
pageInfo(includingnextCursor/hasNextPage). - Updated tests, tool snapshots, and README to reflect the new pagination input and output shape.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/github/dependabot.go | Implements cursor pagination for Dependabot alerts and returns alerts plus pageInfo envelope. |
| pkg/github/dependabot_test.go | Updates tests to use after and validates pageInfo.nextCursor/hasNextPage behavior. |
| pkg/github/toolsnaps/list_dependabot_alerts.snap | Updates the tool input schema snapshot to remove page and add after. |
| README.md | Updates documented inputs for list_dependabot_alerts to replace page with after. |
|
Hey @MayorFaj thanks for your contribution - your fix looks great. Hope you don't mind, but I've pushed a small follow-up commit to your branch to tidy up a couple of things. I made the shared cursor pagination description generic so it works for both REST and GraphQL cursor-based tools, and moved the shared pageInfo helper out of the projects-specific code. |
Thanks @RossTarrant |
Summary
Why
Fixes #2649 #2648
What changed
Fixes
list_dependabot_alertspagination by switching it from page-based pagination to cursor-based pagination.pageparameter fromlist_dependabot_alerts.afterandperPage.pageInfo, so callers can usepageInfo.nextCursorfor the next page.MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs