googleapis/mcp-toolbox · error

invalid timestamp format: %w

Error message

invalid timestamp format: %w

What it means

Time-parse wrap in JSONToFirestoreValue for timestampValue: the string does not parse as RFC3339Nano, the only accepted timestamp format.

Source

Thrown at internal/tools/firestore/util/converter.go:88

						return num, nil
					case int:
						return float64(num), nil
					case int64:
						return float64(num), nil
					}
					return nil, fmt.Errorf("invalid double value: %v", val)
				case "bytesValue":
					// Decode base64 string to bytes
					if str, ok := val.(string); ok {
						return base64.StdEncoding.DecodeString(str)
					}
					return nil, fmt.Errorf("bytes value must be a base64 encoded string")
				case "timestampValue":
					// Parse timestamp
					if str, ok := val.(string); ok {
						t, err := time.Parse(time.RFC3339Nano, str)
						if err != nil {
							return nil, fmt.Errorf("invalid timestamp format: %w", err)
						}
						return t, nil
					}
					return nil, fmt.Errorf("timestamp value must be a string")
				case "geoPointValue":
					// Convert to LatLng
					if geoMap, ok := val.(map[string]any); ok {
						lat, latOk := geoMap["latitude"].(float64)
						lng, lngOk := geoMap["longitude"].(float64)
						if latOk && lngOk {
							return &latlng.LatLng{
								Latitude:  lat,
								Longitude: lng,
							}, nil
						}
					}
					return nil, fmt.Errorf("invalid geopoint value format")
				case "arrayValue":

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Format timestamps as RFC3339 with optional fractional seconds, e.g. '2026-01-02T15:04:05Z'
  2. Include the timezone offset; bare dates like '2026-01-02' are rejected
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/tools/firestore/util/converter.go:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/f663d25de575a963. Report an issue: GitHub.