github/github-mcp-server · error

empty timestamp

Error message

empty timestamp

What it means

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 "".

Source

Thrown at pkg/github/issues.go:3164

			if err != nil {
				return nil, fmt.Errorf("field_filters: %q is not a valid number for %q: %s", rf.Value, field.Name, err.Error())
			}
			v := githubv4.Float(n)
			filter.NumberValue = &v
		default:
			return nil, fmt.Errorf("field_filters: field %q has unsupported data_type %q", field.Name, field.DataType)
		}
		out = append(out, filter)
	}
	return out, nil
}

// parseISOTimestamp parses an ISO 8601 timestamp string into a time.Time object.
// Returns the parsed time or an error if parsing fails.
// Example formats supported: "2023-01-15T14:30:00Z", "2023-01-15"
func parseISOTimestamp(timestamp string) (time.Time, error) {
	if timestamp == "" {
		return time.Time{}, fmt.Errorf("empty timestamp")
	}

	// Try RFC3339 format (standard ISO 8601 with time)
	t, err := time.Parse(time.RFC3339, timestamp)
	if err == nil {
		return t, nil
	}

	// Try simple date format (YYYY-MM-DD)
	t, err = time.Parse("2006-01-02", timestamp)
	if err == nil {
		return t, nil
	}

	// Return error with supported formats
	return time.Time{}, fmt.Errorf("invalid ISO 8601 timestamp: %s (supported formats: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DD)", timestamp)
}

View on GitHub (pinned to 0ea1f775a7)

Solutions

  1. Omit the timestamp parameter when you have no value instead of sending ""
  2. Validate that the variable feeding the argument is non-empty before building the request

Example fix

// before
{"since":"","until":"2023-01-15"}
// after
{"until":"2023-01-15"}
Defensive patterns

Strategy: validation

Validate before calling

func cleanTimestampArg(args map[string]any, key string) {
	if v, ok := args[key].(string); ok && strings.TrimSpace(v) == "" {
		delete(args, key) // omit instead of sending empty string
	}
}

Type guard

func isNonEmptyTimestamp(s string) bool {
	return strings.TrimSpace(s) != ""
}

Prevention

When it happens

Trigger: Passing "" as a timestamp argument, typically because a variable was unset in a script or an LLM filled in an empty placeholder.

Common situations: 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.

Related errors


AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15). Data as JSON: /api/errors/899f60e34afcd58d. Report an issue: GitHub.