Six JSON Schema keywords make Gemma 4 31B return malformed tool-call arguments on Bedrock (minLength: 0/20 correct). Probe + write-up Keiran Holloway reported that six JSON Schema keywords — minLength, maxLength, maxItems, minLength on array items, uniqueItems and, to a lesser degree, minItems and pattern — caused Gemma 4 31B on Bedrock's OpenAI-compatible endpoint to return malformed tool-call arguments, with minLength: 1, maxLength: 50, maxItems: 10, minLength on array items and uniqueItems each producing 0/20 correct calls versus 20/20 for the control. Holloway attributed the failures to the serving layer rather than the model, noting that empty arrays returned for maxItems and minLength-on-items are valid JSON so tools run with missing input, and recommended stripping the six keywords from the schema copy sent to Gemma while keeping validation on the tool server. The findings rest on 20 calls per arm, one model size and one host, with constrained decoding an unproven guess, and Holloway asked whether vLLM, llama.cpp or other hosted providers show the same behavior. I spent a while chasing broken tool calls from Gemma 4 31B Bedrock’s OpenAI-compatible endpoint and narrowed part of it down to something I haven’t seen reported: specific JSON Schema keywords on a tool parameter. Each keyword tested alone on a five-parameter tool, 20 calls per arm, with one earlier tool call in the history: | Keyword on one parameter | Correct | What comes back | |---|---|---| | none control | 20/20 | | | minLength: 1 | 0/20 | ":" , "};network" | | maxLength: 50 | 0/20 | same kind of thing | | maxItems: 10 | 0/20 | every time | | minLength on array items | 0/20 | every time | | minItems: 1 | 7/20 | malformed items | | pattern | 17/20 | value padded with dashes | | uniqueItems | 0/20 | HTTP 400 | | minimum, maximum, enum, default, format, anyOf null | 20/20 | | Why I think it’s the serving layer and not the model: The nasty ones are maxItems and minLength on items: an empty array is valid JSON, so your tool just runs with missing input. Second trigger: free-form objects no declared properties and untyped arrays. Keys the model has to invent come back with stray punctuation, e.g. ",bool" , ",must" . Declared keys are fine. Workarounds that held up for me: strip those six keywords from the schema copy sent to Gemma keep validating on the tool server , and present free-form values as a string holding JSON text, then decode. Caveats: one model size, one host, root cause unproven constrained decoding is my guess , and 20 calls per arm. If your validation library emits these keywords e.g. .min 1 , it’s worth checking your schemas. Write-up: Six JSON Schema keywords that appear to corrupt Gemma 4 tool calls | Keiran Holloway https://keiranholloway.github.io/gemma4-toolcall-probe/ Probe single file, any OpenAI-compatible endpoint : GitHub - keiranholloway/gemma4-toolcall-probe: Probe an OpenAI-compatible endpoint for damaged Gemma 4 tool-call arguments · GitHub https://github.com/keiranholloway/gemma4-toolcall-probe Has anyone seen the same on vLLM, llama.cpp or another hosted provider? I’d like to know whether this is specific to Bedrock.