list_repo_labels: limit/page parameters not exposed — hard cap at 50 labels causes silent duplicate creation #289
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human-required
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp#289
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
list_repo_labelsdoes not expose the Forgejo REST API'slimitandpagequery parameters. Calls are silently capped at 50 labels regardless of anylimitvalue passed in the tool arguments.Steps to reproduce
list_repo_labelswithlimit: 1000.Impact
Any consumer that builds a name→ID map from
list_repo_labelsand then conditionally creates-or-updates labels will silently create duplicate labels for every label beyond position 50. The label name appears absent from the map, socreate_repo_labelis called even though the label already exists — and Forgejo'sPOST /repos/{owner}/{repo}/labelsis not idempotent.Observed in practice: running
castra init-labels(a label-upsert tool) three times on a 57-label repo produced 35 duplicate labels that had to be manually deleted.Underlying Forgejo API
GET /repos/{owner}/{repo}/labelssupportslimit(1–50) andpage(1-based) query parameters. Pagination is fully supported server-side; the MCP tool just doesn't expose it.Proposed fix
Add
limit(integer, default 20, max 50) andpage(integer, default 1) to thelist_repo_labelstool schema, forwarding them directly to the Forgejo API. Consumers can then paginate by incrementingpageuntil the response length is less thanlimit.Workaround
Until this is fixed, bypass
list_repo_labelsand call the REST API directly withcurl: