{"record":{"id":"899f60e34afcd58d","repo":"github/github-mcp-server","slug":"empty-timestamp","errorCode":null,"errorMessage":"empty timestamp","messagePattern":"empty timestamp","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/issues.go","lineNumber":3164,"sourceCode":"\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}\n\n\t// Try RFC3339 format (standard ISO 8601 with time)\n\tt, err := time.Parse(time.RFC3339, timestamp)\n\tif err == nil {\n\t\treturn t, nil\n\t}\n\n\t// Try simple date format (YYYY-MM-DD)\n\tt, err = time.Parse(\"2006-01-02\", timestamp)\n\tif err == nil {\n\t\treturn t, nil\n\t}\n\n\t// Return error with supported formats\n\treturn time.Time{}, fmt.Errorf(\"invalid ISO 8601 timestamp: %s (supported formats: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD)\", timestamp)\n}\n","sourceCodeStart":3146,"sourceCodeEnd":3182,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/issues.go#L3146-L3182","documentation":"parseISOTimestamp rejects an empty string before attempting any format. Timestamp parameters (e.g. since/until style issue filters) must be non-empty ISO 8601 values; callers should omit the parameter entirely rather than send \"\".","triggerScenarios":"Passing \"\" as a timestamp argument, typically because a variable was unset in a script or an LLM filled in an empty placeholder.","commonSituations":"Templates that always include the key: \"since\":\"\"; optional-date logic that defaults to empty string instead of omitting the key; chain-of-custody bugs where a prior step produced an empty value.","solutions":["Omit the timestamp parameter when you have no value instead of sending \"\"","Validate that the variable feeding the argument is non-empty before building the request"],"exampleFix":"// before\n{\"since\":\"\",\"until\":\"2023-01-15\"}\n// after\n{\"until\":\"2023-01-15\"}","handlingStrategy":"validation","validationCode":"func cleanTimestampArg(args map[string]any, key string) {\n\tif v, ok := args[key].(string); ok && strings.TrimSpace(v) == \"\" {\n\t\tdelete(args, key) // omit instead of sending empty string\n\t}\n}","typeGuard":"func isNonEmptyTimestamp(s string) bool {\n\treturn strings.TrimSpace(s) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Delete optional timestamp keys instead of sending \"\"","Assert every timestamp argument is non-empty before dispatch"],"tags":["validation","timestamp","issues","empty-value"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}