Skip to content

Paginate project listing#4

Open
alesp56 wants to merge 1 commit into
tgeselle:masterfrom
alesp56:pagination
Open

Paginate project listing#4
alesp56 wants to merge 1 commit into
tgeselle:masterfrom
alesp56:pagination

Conversation

@alesp56

@alesp56 alesp56 commented Jan 15, 2026

Copy link
Copy Markdown
  • Summary

    • Add reusable pagination helper for list endpoints.
    • Fetch all project pages in list_projects and organization resources.
    • Prevent missing projects when org has >30 projects.
  • Testing

    • Ran locally via MCP Inspector (list_projects shows all projects).

@alesp56 alesp56 marked this pull request as ready for review January 15, 2026 11:56

@tgeselle tgeselle left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean PR — fixes a real pagination bug with a reusable helper. One suggestion to future-proof it.

Comment thread src/api/pagination.ts
): Promise<T[]> {
const results: T[] = [];
let page = 1;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This while (true) has no upper bound. For project listings it's fine, but as a reusable helper, someone could later use this for events or errors (thousands of pages) and fire unbounded sequential requests.

Consider adding a safety limit:

Suggested change
let page = 1;
const maxPages = 50;

Then check page >= maxPages in the loop. A maxPages parameter with a sensible default would also work.

@tgeselle

Copy link
Copy Markdown
Owner

Also — this is missing a version bump in package.json / package-lock.json. Since it changes runtime behavior (pagination), it should get a minor version bump.

@mschadegg

Copy link
Copy Markdown

Can we expect this to be released soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants