A developer reports that a demo script for an MCP (Model Context Protocol) server fails on its first live run, revealing a production bug that unit tests did not catch. The server wraps Google’s gemini-3.1-flash-lite-image model and exposes tools for image generation and stateful image editing. Before calling the API, the server locally validates tool arguments using an allowlist of permitted thinking_level values. The code initially allows four values—“minimal,” “low,” “medium,” and “high”—and defaults thinking_level to “medium.”

In the demo workflow, the developer runs a generation step requesting thinking_level “minimal.” The live API returns an HTTP 400 invalid_request error stating that “minimal” is not supported and that only “low” and “high” are allowed. Because the server’s validation approves the values locally, default parameters that remain “medium” also fail in real usage. The author says the test suite misses the issue because it mocks the API client and therefore can only confirm that the server forwards inputs as written, not that the remote contract accepts them.

The fix removes the extra values from the local allowlist, changes the default thinking_level, and adds a regression test intended to verify the mismatch is rejected with a readable error. The developer also rebuilds and republishes the Docker image and performs a live smoke check using default parameters.