Skip to content

fix: paginate list_wiki_pages to return all results#7

Open
Lcstyle wants to merge 1 commit intoraohwork:masterfrom
Lcstyle:fix/wiki-list-pagination
Open

fix: paginate list_wiki_pages to return all results#7
Lcstyle wants to merge 1 commit intoraohwork:masterfrom
Lcstyle:fix/wiki-list-pagination

Conversation

@Lcstyle
Copy link
Copy Markdown

@Lcstyle Lcstyle commented Mar 26, 2026

Summary

  • list_wiki_pages now paginates through all results instead of returning only the first 30 (Gitea's default limit)
  • Uses page and limit query parameters, collecting results until a partial page indicates the end
  • 3 unit tests: multi-page pagination (50+30=80 pages), single-page optimization (no extra request), empty wiki error handling

Problem

MyListWikiPages made a single API request to /repos/{owner}/{repo}/wiki/pages without any pagination parameters. The Gitea API defaults to returning 30 items per page, so wikis with more than 30 pages appeared truncated. For example, a repository with 162 wiki pages would only show 30 to MCP clients.

Test plan

  • 3 new TestMyListWikiPages_Pagination tests pass
  • All existing tests pass (0 regressions)
  • Manual verification: repository with 162 wiki pages now returns all 162 via MCP

🤖 Generated with Claude Code

MyListWikiPages made a single API request without pagination parameters,
so it only returned the first 30 pages (Gitea's default limit). Wikis
with more than 30 pages appeared truncated to MCP clients.

Now paginates through all results using page/limit query parameters,
collecting results until a partial page indicates the end.

Includes 3 unit tests: multi-page pagination, single-page optimization,
and empty wiki error handling.
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.

1 participant