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 both

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Look at the quoted field name in the message and inspect that field's value.
  2. Follow the guidance for the wrapped inner error (timestamp format, geopoint shape, etc.).
  3. 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

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


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