googleapis/mcp-toolbox · error
/api native endpoints are disabled by default. Please use th
Error message
/api native endpoints are disabled by default. Please use the standard /mcp JSON-RPC endpoint
What it means
convertPlainMap converts an ordinary (non-typed) JSON map field-by-field by recursing into JSONToFirestoreValue. If any field's conversion fails, the error is wrapped as "field %q: %w" naming the field key. This is a wrapper error; the real cause is the wrapped inner error.
Source
Thrown at internal/server/server.go:601
})
}
// control plane
mcpR, err := mcpRouter(s)
if err != nil {
return nil, err
}
r.Mount("/mcp", mcpR)
if cfg.EnableAPI {
apiR, err := apiRouter(s)
if err != nil {
return nil, err
}
r.Mount("/api", apiR)
} else {
r.Handle("/api/*", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
err := errors.New("/api native endpoints are disabled by default. Please use the standard /mcp JSON-RPC endpoint")
_ = render.Render(w, r, newErrResponse(err, http.StatusGone))
}))
}
if cfg.UI {
webR, err := webRouter()
if err != nil {
return nil, err
}
r.Mount("/ui", webR)
}
// default endpoint for validating server is running
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte("🧰 Hello, World! 🧰"))
})
// healthz endpoint for container orchestration health checks
// (Kubernetes liveness/readiness probes, Docker HEALTHCHECK, etc.).
// Returns 200 OK with a small JSON body so probes can rely on bothView on GitHub (pinned to 8cc6e09de2)
Solutions
- Look at the quoted field name in the message and inspect that field's value.
- Follow the guidance for the wrapped inner error (timestamp format, geopoint shape, etc.).
- Pre-validate each field with JSONToFirestoreValue to isolate the offender.
Example fix
// before
{"dueDate": {"timestampValue": "tomorrow"}}
// after
{"dueDate": {"timestampValue": "2024-01-02T00:00:00Z"}} Defensive patterns
Strategy: try-catch
Validate before calling
for k, v := range plainMap {
if _, err := JSONToFirestoreValue(v, client); err != nil { return fmt.Errorf("field %q invalid: %w", k, err) }
} Try / catch
if _, err := JSONToFirestoreValue(doc, client); err != nil {
var field string
if n, _ := fmt.Sscanf(err.Error(), "field %q", &field); n == 1 { /* inspect field, follow wrapped inner error */ }
} Prevention
- Validate each field of a document before submitting
- Read errors.Unwrap chains to find the root cause
- Keep field value types consistent with Firestore's typed-value shapes
When it happens
Trigger: Any plain map passed through JSONToFirestoreValue (or the default branch of the typed-value switch) that contains a field whose value fails conversion, e.g. {"createdAt": {"timestampValue": "bad"}}.
Common situations: Document payloads from HTTP requests where one field is mistyped; configs with nested timestamps or geopoints in non-standard formats.
Related errors
- Invalid JSON format for ${paramName}. Expected an array. ${e
- Invalid number input for ${NAME}: ${RAW_VALUE}
- Input for ${paramName} must be a JSON array (e.g., ["a", "b"
- Toolbox binary not found
- HTTP error! status: ${response.status}
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/3b1fdafd0ad61ae1.
Report an issue: GitHub.