Uh oh!
There was an error while loading. Please reload this page.
Add repo-scoped support to list_issue_types tool - #2692
Conversation
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
| - **list_issue_types** - List available issue types | ||
| - **Required OAuth Scopes**: `read:org` | ||
| - **Accepted OAuth Scopes**: `admin:org`, `read:org`, `write:org` | ||
| - `owner`: The organization owner of the repository (string, required) | ||
| - **Required OAuth Scopes**: `repo`, `read:org` | ||
| - **Accepted OAuth Scopes**: `admin:org`, `read:org`, `repo`, `write:org` |
491b7cf to
6d57655Compare6d57655 to
096cdb5Compare
RossTarrant
left a comment
There was a problem hiding this comment.
Looks great! Just two comments, let me know your thoughts!
There was a problem hiding this comment.
Does this description need updating to reflect the changes you are making? I feel like it might need tweaking a bit but open to discussion on this! 😄
There was a problem hiding this comment.
Makes sense! Let me know if this is clear: 9fa8dce
There was a problem hiding this comment.
Same with this one as my previous comment, again open to discussion on this!
Summary
Adds optional
repoparameter tolist_issue_typesso coding/cloud agents can list issue types using onlymetadata:readinstead oforg:read.Closeshttps://github.com/github/plan-track-agentic-toolkit/issues/125
depends on https://github.com/github/github/pull/436186
Why
Cloud agent / SWE agent / coding agent don't have the
orgscope, which blocked them from usinglist_issue_types. Matches the list_issue_fields implementationWhat 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.