{"record":{"id":"37b6c33b551023cc","repo":"github/github-mcp-server","slug":"field-filters-q-is-not-a-valid-option-for-q-va","errorCode":null,"errorMessage":"field_filters: %q is not a valid option for %q. Valid options: %s","messagePattern":"field_filters: %q is not a valid option for %q\\. Valid options: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/issues.go","lineNumber":3131,"sourceCode":"\n\t\tfilter := IssueFieldValueFilter{FieldName: githubv4.String(field.Name)}\n\t\tswitch field.DataType {\n\t\tcase \"SINGLE_SELECT\":\n\t\t\t// Validate the option name against the field's options so we fail fast\n\t\t\t// with a useful error instead of an opaque GraphQL one.\n\t\t\tvar matched string\n\t\t\tfor _, o := range field.Options {\n\t\t\t\tif strings.EqualFold(o.Name, rf.Value) {\n\t\t\t\t\tmatched = o.Name\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif matched == \"\" {\n\t\t\t\toptionNames := make([]string, 0, len(field.Options))\n\t\t\t\tfor _, o := range field.Options {\n\t\t\t\t\toptionNames = append(optionNames, o.Name)\n\t\t\t\t}\n\t\t\t\treturn nil, fmt.Errorf(\"field_filters: %q is not a valid option for %q. Valid options: %s\", rf.Value, field.Name, strings.Join(optionNames, \", \"))\n\t\t\t}\n\t\t\tv := githubv4.String(matched)\n\t\t\tfilter.SingleSelectOptionValue = &v\n\t\tcase \"TEXT\":\n\t\t\tv := githubv4.String(rf.Value)\n\t\t\tfilter.TextValue = &v\n\t\tcase \"DATE\":\n\t\t\tif _, err := time.Parse(\"2006-01-02\", rf.Value); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"field_filters: %q is not a valid date for %q (expected YYYY-MM-DD): %s\", rf.Value, field.Name, err.Error())\n\t\t\t}\n\t\t\tv := githubv4.String(rf.Value)\n\t\t\tfilter.DateValue = &v\n\t\tcase \"NUMBER\":\n\t\t\tn, err := strconv.ParseFloat(rf.Value, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"field_filters: %q is not a valid number for %q: %s\", rf.Value, field.Name, err.Error())\n\t\t\t}\n\t\t\tv := githubv4.Float(n)","sourceCodeStart":3113,"sourceCodeEnd":3149,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/issues.go#L3113-L3149","documentation":"For a SINGLE_SELECT issue field, resolveFieldFilters validates the supplied value against the field's configured options (case-insensitive match) before sending the GraphQL query, and reports all valid option names on mismatch. This avoids an opaque GraphQL error from GitHub.","triggerScenarios":"field_filters entry with a SINGLE_SELECT field (e.g. Status) and a value that is not one of its options, e.g. {\"field_name\":\"Status\",\"value\":\"Won't Fix\"} when the options are Bug, In Progress, Done.","commonSituations":"Options renamed or removed by project admins; an LLM guessing an option name; locale/casing variants like \"done\" are fine (case-insensitive) but abbreviations like \"wontfix\" are not.","solutions":["Use one of the option names listed in the error's 'Valid options' section exactly (case-insensitive)","Re-fetch the field definitions to see current options if they were changed recently","Ask the repo admin to add the option if it genuinely should exist"],"exampleFix":"// before\n{\"field_filters\":[{\"field_name\":\"Status\",\"value\":\"wontfix\"}]}\n// after\n{\"field_filters\":[{\"field_name\":\"Status\",\"value\":\"Won't Fix\"}]}","handlingStrategy":"validation","validationCode":"func validateSingleSelectOption(value string, options []string) error {\n\tfor _, o := range options {\n\t\tif strings.EqualFold(o, value) {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"%q is not a valid option; valid: %s\", value, strings.Join(options, \", \"))\n}","typeGuard":"func isValidOption(value string, options []string) bool {\n\tfor _, o := range options {\n\t\tif strings.EqualFold(o, value) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"is not a valid option for\") {\n    // Message includes 'Valid options:'; choose one of those and retry.\n}","preventionTips":["Cache each SINGLE_SELECT field's options and validate before sending","Remember option matching is case-insensitive — fix spelling, not casing"],"tags":["validation","field-filters","single-select","issues"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}