Add list_org_issue_fields tool#2445
Open
kelsey-myers wants to merge 6 commits intogithub:mainfrom
Open
Conversation
Contributor
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
15 tasks
Author
|
Returns: |
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
Add a new
list_org_issue_fieldsMCP tool that retrieves issue field definitions for a GitHub organization, including field names, types, and single-select options.Why
Enables AI agents to discover available custom issue fields for an organization, which is necessary for workflows that create or update issues with custom field values.
Fixes https://github.com/github/plan-track-agentic-toolkit/issues/38
Picks up where #2438 left off (originally authored by @michaeljacholke). Additional changes in this PR:
created_at/updated_atfromIssueFieldandIssueSingleSelectFieldOptionper feedbackghErrors.NewGitHubAPIErrorResponsefor consistency with other toolsexpectError=truefor forbidden/500 test cases to properly assert error behaviorWhat changed
issue_fields.gowithListOrgIssueFieldstool implementation, callingGET /orgs/{org}/issue-fieldsissue_fields_test.gowith unit tests covering success, 404 (empty list), 403, 500, and missing parameter casestools.gounder the issues toolsetlist_org_issue_fields.snapREADME.mdwith tool documentationMCP impact
list_org_issue_fields— a read-only tool that lists organization-level issue field definitions (text, number, date, single_select) and their options. Requiresread:orgscope.Prompts tested (tool changes only)
Security / limits
Requires
read:orgOAuth scope. Returns empty list on 404 (org doesn't have issue fields enabled) rather than exposing error details.Tool renaming
Lint & tests
./script/lint./script/testDocs