googleapis/mcp-toolbox · error
invalid integer value: %v
Error message
invalid integer value: %v
What it means
Type-switch default in JSONToFirestoreValue for integerValue: a value tagged integerValue is a string that strconv.ParseInt cannot parse (or a non-numeric JSON type), so it cannot be converted to int64.
Source
Thrown at internal/tools/firestore/util/converter.go:61
return nil, nil
case "booleanValue":
return val, nil
case "stringValue":
return val, nil
case "integerValue":
// Convert to int64
switch num := val.(type) {
case float64:
return int64(num), nil
case int:
return int64(num), nil
case int64:
return num, nil
case string:
// Parse string representation using strconv for better performance
i, err := strconv.ParseInt(strings.TrimSpace(num), 10, 64)
if err != nil {
return nil, fmt.Errorf("invalid integer value: %v", val)
}
return i, nil
}
return nil, fmt.Errorf("invalid integer value: %v", val)
case "doubleValue":
// Convert to float64
switch num := val.(type) {
case float64:
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 {View on GitHub (pinned to 8cc6e09de2)
Solutions
- Send the integer directly as a JSON number instead of a string
- If it must be a string, ensure it is a well-formed base-10 integer with no units or whitespace beyond padding
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/firestore/util/converter.go:61 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/88726a17293d67b1.
Report an issue: GitHub.