list_repo_labels does not list organization level labels #125
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#125
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?
The MCP does not expose organization-level labels at all. Though I believe they should be exposed by the
list_repo_labelstool as there is no reason for the model to make 2 separate requests.Assessed. Confirmed gap.
Root cause:
list_repo_labelsinoperation/issue/issue.gocallsClient().ListRepoLabels(...)→ only/repos/{owner}/{repo}/labels. Forgejo API also exposes/orgs/{org}/labels, butforgejo-sdk/forgejo/v3@v3.0.0has no binding for it. So org-owned repos can carry org labels on issues, but MCP cannot list them — the model has no way to discover the IDs.Implementation path (no SDK upgrade required):
list_org_labels(org, page, limit)— direct mapping to/orgs/{org}/labels.list_repo_labelswithinclude_org_labels(bool, defaulttrue). When the repo owner is an org, merge org labels into the result and tag each label withscope: "repo" | "org"so callers can disambiguate IDs.pkg/forgejo.DoJSONListraw-HTTP helper (already used for attachments). 404 from the org endpoint maps to empty list — no error. Same auth/UA/logging as the rest of the client.httptest.Servermatchingpkg/forgejo/*_test.gopatterns: repo-only, org-only, merged, 404 → empty,include_org_labels=falsesuppresses merge.Tradeoffs: one extra HTTP call when merge is enabled. Worth it — eliminates the round-trip the model would otherwise need to do explicitly. Standalone
list_org_labelskeeps single-responsibility for callers that already know the org.Tracked internally as
forgejo-mcp-7ch, withforgejo-mcp-xv0as the OpenSpec change preceding implementation.Followups for you, if convenient: any specific repo/org pair you'd like used as the integration test fixture?
@enbyted — would you mind reviewing the OpenSpec change for this issue before I start implementation?
It's on branch
issues/125:scopefield, D5 unconditional GET)list_repo_labelsrequirements with merge +scopetaggingParticular things I'd value your eye on:
include_org_labels—true(you suggested merged behavior; want to confirm default-on matches your expectation).page/limitacross both scopes. Acceptable or would you prefer split parameters?scopefield naming/values ("repo"|"org") — happy with these, or preferrepository/organizationlong form?No rush — happy to wait a couple days for feedback before I land code.