{"record":{"id":"f99abe994b09730d","repo":"github/github-mcp-server","slug":"field-filters-q-is-not-a-valid-number-for-q-s","errorCode":null,"errorMessage":"field_filters: %q is not a valid number for %q: %s","messagePattern":"field_filters: %q is not a valid number for %q: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/issues.go","lineNumber":3147,"sourceCode":"\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)\n\t\t\tfilter.NumberValue = &v\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"field_filters: field %q has unsupported data_type %q\", field.Name, field.DataType)\n\t\t}\n\t\tout = append(out, filter)\n\t}\n\treturn out, nil\n}\n\n// parseISOTimestamp parses an ISO 8601 timestamp string into a time.Time object.\n// Returns the parsed time or an error if parsing fails.\n// Example formats supported: \"2023-01-15T14:30:00Z\", \"2023-01-15\"\nfunc parseISOTimestamp(timestamp string) (time.Time, error) {\n\tif timestamp == \"\" {\n\t\treturn time.Time{}, fmt.Errorf(\"empty timestamp\")\n\t}","sourceCodeStart":3129,"sourceCodeEnd":3165,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/issues.go#L3129-L3165","documentation":"For a NUMBER issue field, resolveFieldFilters parses the string value with strconv.ParseFloat and reports the parse error on failure. Values must be numeric strings; scientific notation (1e3) is accepted by ParseFloat, but thousand separators, units, and empty strings are not.","triggerScenarios":"field_filters entry on a NUMBER field with a value like \"1,000\", \"~5\", \"3 stars\", or \"\".","commonSituations":"Locale-formatted numbers with commas or decimal commas; an LLM appending units; copying display-formatted values from UI text.","solutions":["Send a plain numeric string such as \"42\" or \"3.14\"","Strip thousand separators and units before sending","For integer-typed fields, prefer values without decimal points to avoid surprising matches"],"exampleFix":"// before\n{\"field_filters\":[{\"field_name\":\"Points\",\"value\":\"1,000\"}]}\n// after\n{\"field_filters\":[{\"field_name\":\"Points\",\"value\":\"1000\"}]}","handlingStrategy":"validation","validationCode":"func validFilterNumber(s string) bool {\n\tif s == \"\" {\n\t\treturn false\n\t}\n\t_, err := strconv.ParseFloat(s, 64)\n\treturn err == nil\n}","typeGuard":"func isNumericString(s string) bool {\n\t_, err := strconv.ParseFloat(strings.TrimSpace(s), 64)\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["Strip commas, currency symbols, and units from numbers before sending","Run strconv.ParseFloat client-side on every NUMBER filter value"],"tags":["validation","field-filters","number","issues"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}