Add custom field filtering to list_issues#2480
Open
kelsey-myers wants to merge 1 commit into
Open
Conversation
Author
|
Sample Input: Sample Output: |
This comment has been minimized.
This comment has been minimized.
leuasseurfarrelds247-arch
approved these changes
May 15, 2026
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds custom field filtering to list_issues by threading an issueFieldValues GraphQL variable through all four ListIssuesQuery* variants and opting into the issue_fields GraphQL feature flag via header. A new field_filters array parameter accepts entries with field_name plus exactly one typed value (single-select/text/number/date), enforced by a new parseFieldFilters helper.
Changes:
- New
IssueFieldValueFilterstruct andfield_filtersMCP parameter onlist_issues, withparseFieldFiltersvalidating exactly one typed value per entry (treatingnumber_value: 0as set). - All four
ListIssuesQuery*variants now includefilterBy: {issueFieldValues: $issueFieldValues}; the variable is always sent (empty slice = no-op) and the request context carriesGraphQL-Features: issue_fields. - Comprehensive unit tests for each query variant, each typed value, validation errors, the
number_value: 0edge case, and aGraphQL-Featuresheader regression guard.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issues.go | Adds IssueFieldValueFilter, field_filters schema, parseFieldFilters, threads issueFieldValues and feature header through list_issues. |
| pkg/github/issues_test.go | Updates existing test vars/queries and adds Test_ListIssues_FieldFilters covering all variants, validation, and header behavior. |
| pkg/github/toolsnaps/list_issues.snap | Toolsnap regenerated to include the new field_filters schema. |
| README.md | Auto-generated doc entry for the new field_filters parameter. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 0
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
Extend
list_issuesso callers can filter issues by custom field values (single-select, text, number, date) alongside the existing label, state, andsincefilters.Why
The
IssueFilters.issueFieldValuesargument is available in the GraphQL schema (gated by theissue_fieldsfeature flag) and the existinglist_issuestool returns field values on each issue, but there was no way to filter by them. Without this, agents have to fetch all issues and filter client-side which doesn't scale and is wasteful.Stacked on top of #2466 — will retarget once that merges. Until then this PR shows both sets of commits.
What changed
field_filtersarray parameter tolist_issues. Each entry takes afield_nameplus exactly one ofsingle_select_value,text_value,number_value, ordate_value.ListIssuesQuery*variants via a newissueFieldValuesGraphQL variable. The variable is always sent (empty slice when no filters are supplied), the resolver treats an empty list as a no-op.parseFieldFiltershelper that validates exactly one typed value per filter and propagates type errors uniformly.GraphQL-Features: issue_fieldson outgoing requests via the existingGraphQLFeaturesTransportso the gated input type resolves while the flag is still rolling out. Safe to keep after rollout (no-op).number_value: 0(must be treated as set), and a regression guard that theGraphQL-Featuresheader is sent.MCP impact
list_issuesgains an optionalfield_filtersparameter. Default behaviour (nofield_filters) is unchanged.Prompts tested (tool changes only)
sincepath (regression)github/issuesSecurity / limits
No new auth surface. Uses the same scopes as
list_issuestoday. TheGraphQL-Featuresheader opts into a schema-level feature flag and does not bypass any authorization.Tool renaming
Lint & tests
./script/lint./script/testDocs
script/generate-docsregeneratedREADME.mdand thelist_issuestoolsnap.