Skip to content

Add list_org_issue_fields tool#2438

Draft
michaeljacholke wants to merge 3 commits intogithub:mainfrom
michaeljacholke:mj/add-list-org-issue-fields
Draft

Add list_org_issue_fields tool#2438
michaeljacholke wants to merge 3 commits intogithub:mainfrom
michaeljacholke:mj/add-list-org-issue-fields

Conversation

@michaeljacholke
Copy link
Copy Markdown

@michaeljacholke michaeljacholke commented May 7, 2026

Summary

Add a new list_org_issue_fields MCP 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

What changed

  • Added issue_fields.go with ListOrgIssueFields tool implementation, calling GET /orgs/{org}/issue-fields
  • Added issue_fields_test.go with unit tests covering success, 404 (empty list), and missing parameter cases
  • Registered the tool in tools.go under the issues toolset
  • Added toolsnap list_org_issue_fields.snap
  • Updated README.md with tool documentation

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added
    list_org_issue_fields — a read-only tool that lists organization-level issue field definitions (text, number, date, single_select) and their options. Requires read:org scope.

Prompts tested (tool changes only)

  • "List all issue fields for the github org"
  • "What custom fields are available for issues in my organization?"

Security / limits

  • No security or limits impact
  • Auth / permissions considered
    Requires read:org OAuth scope. Returns empty list on 404 (org doesn't have issue fields enabled) rather than exposing error details.
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

}

reqURL := fmt.Sprintf("orgs/%s/issue-fields", org)
req, err := client.NewRequest(http.MethodGet, reqURL, nil)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Using raw client.NewRequest/client.Do here because the issue-fields API isn't yet in go-github.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. Pls link the go github issue that is tracking updating to the new rest version. It's from March or so. We should have it in mind to update this once the lib is updated

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread README.md

- **list_org_issue_fields** - List organization issue fields
- **Required OAuth Scopes**: `read:org`
- **Accepted OAuth Scopes**: `admin:org`, `read:org`, `write:org`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm can you check pls the rest endpoint? I think repo should be there too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a look and the endpoint is org-scoped so I don't think we need the repo param

Comment thread pkg/github/issue_fields.go Outdated
// IssueFieldOption represents an option for a single_select issue field.
type IssueFieldOption struct {
ID int64 `json:"id"`
Name string `json:"name"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please double check this with the rest schema. I think color is there too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated - df12a08

Comment thread pkg/github/issue_fields.go Outdated
}

// IssueFieldOption represents an option for a single_select issue field.
type IssueFieldOption struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might add multiselct

Suggested change
type IssueFieldOption struct {
type IssueSingleSelectFieldOption struct {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - df12a08

}

reqURL := fmt.Sprintf("orgs/%s/issue-fields", org)
req, err := client.NewRequest(http.MethodGet, reqURL, nil)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. Pls link the go github issue that is tracking updating to the new rest version. It's from March or so. We should have it in mind to update this once the lib is updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants