Uh oh!
There was an error while loading. Please reload this page.
Add list_issue_fields tool - #2445
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new read-only MCP tool to list organization-level issue field definitions (including single-select options) so agents can discover valid custom fields before creating/updating issues.
Changes:
- Implemented
list_org_issue_fieldstool callingGET /orgs/{org}/issue-fields, with 404 returning an empty list. - Added unit tests covering success and common error scenarios.
- Registered the tool, added a toolsnap, and updated README tool docs.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new list_org_issue_fields tool and required scopes. |
| pkg/github/tools.go | Registers the new tool in the issues toolset. |
| pkg/github/issue_fields.go | Implements the tool and response types for org issue fields/options. |
| pkg/github/issue_fields_test.go | Adds unit tests for the new tool behavior. |
| pkg/github/toolsnaps/list_org_issue_fields.snap | Captures the tool schema snapshot for regression checking. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 2
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Returns: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kelsey-myers
commented
May 20, 2026
Uh oh!
There was an error while loading. Please reload this page.
Resolve conflict in pkg/github/issue_fields.go between the squash-merged list_issue_fields tool (#2445) on main and this branch's earlier copy: - Keep main's first: 100 limit and the issue_fields + repo_issue_fields GraphQL feature flags. - Retain this branch's fetchIssueFields / issueFieldsFromNodes helpers, which are used by list_issues for custom field filtering, and rewire ListIssueFields through them to avoid duplication.
Summary
Adds a
list_issue_fieldstool that returns field definitions (name, type, options) for a GitHub org or repo. Picks up where #2438 left off, with some direction changes since.Why
Agents need to discover available custom fields before they can set field values on issues. Without this, they're guessing field names and types.
Fixeshttps://github.com/github/plan-track-agentic-toolkit/issues/38
What changed
list_issue_fieldstool — queriesrepository.issueFieldsororganization.issueFieldsvia GraphQL depending on whetherrepois passedrepois optional: passing owner+repo returns fields inherited from the org; passing owner alone returns org-level fields directlyrepoorread:org(either suffices, matchinglist_issue_typesapproach)WithGraphQLFeatures(ctx, "issue_fields")so the query hits the feature-flagged field on the monolithMCP impact
list_issue_fields— read-only tool returning field definitions (id, name, data_type, visibility, options for single_select). Requiresrepoorread:orgscope.Prompts tested
Security / limits
repoorread:orgrequired. User-owned repos return[](no error) — monolith returns null for non-org owners, which resolves to an empty list naturally.Tool renaming
Note: the original PR used
list_org_issue_fields— renamed tolist_issue_fieldssince it now covers both repo and org.Lint & tests
Docs