#1479·GenieX

Gemma-4-26B (GGUF, GenieX-served) does not reliably conform to provided tool-call JSON schema — flattens nested arguments and guesses tool/parameter names instead of reading the schema

Author: EurusZhangCreated Sep 22, 2026Updated Sep 24, 2026

Describe the bug

Used as a tool-calling agent (Pi Agent, MCP tools), google/gemma-4-26B-A4B-it-qat-q4_0-gguf:Q4_0 reliably fails to conform to the exact tool-call schema it is given:

  1. Flattens nested arguments. For a tool whose schema requires a nested object parameter — e.g. execute_action(device_id: str, action: {action: str, point?: [number, number], ...}) — the model emits the inner fields as top-level siblings instead, e.g. {"action": "CLICK", "point": [142, 440], "device_id": "..."}, even when the tool's own description explicitly warns against this exact mistake.
  2. Guesses tool/parameter names instead of reading them. For a proxy-style tool that dispatches to a named sub-tool (call shape {"tool": "<name>", "args": {...}}), the model guesses a plausible but nonexistent sub-tool/parameter name instead of the one documented in the tool's own description. When the resulting error names the correct one in a "Did you mean" hint, the next attempt still doesn't use it.

A same-session, same-tools, same-prompt comparison with the model swapped to Claude produced the correct sub-tool and parameter name on the first attempt, no retry needed — ruling out schema clarity or environment/configuration as the cause.

To Reproduce

  1. Configure this model as a tool-calling agent.
  2. Give it a tool whose schema requires a nested object parameter, with a description that documents the correct shape and warns against flattening.
  3. Ask for an action requiring that tool.
  4. Observe the nested object flattened into top-level siblings, failing schema validation.
  5. Separately, give it a proxy-style tool exposing several sub-tools documented only in its own description text.
  6. Ask for an action requiring one of them; observe it guesses a generic sub-tool/parameter name rather than the documented one, and does not self-correct even after a validation error names the right one.

Expected behavior

The model should conform exactly to the tool-call schema and documented sub-tool/parameter names for the current request — matching the behavior already observed from other models (e.g. Claude) given the identical schema and prompt, including using a validation error's correction hint on the very next retry.

Screenshots

Not applicable.

Desktop (please complete the following information):

  • OS: Windows 11 Enterprise
  • Browser: N/A — reproduced via the Pi Agent CLI against GenieX
  • Version: google/gemma-4-26B-A4B-it-qat-q4_0-gguf:Q4_0, served via GenieX at 10.92.139.252:18181

Smartphone (please complete the following information):

Not applicable — the Android device involved in some reproductions was the automation target, not the software under test; the defect is in the model's tool-call generation.

Additional context

Reproduced independently 3 times across 2 unrelated tools and 2 separate deployments, ruling out a one-off fluke or a deployment-specific misconfiguration. A schema-side mitigation was already tried on the Android-automation tool — replacing an unconstrained parameter with a strictly-validated nested schema plus an explicit anti-flattening warning in the tool description — and it did not change the behavior; the model kept flattening exactly as before. A grammar_string (GBNF constrained-decoding) field exists on this serving API but was found to be a no-op for this model/backend in a separate test; if that gets fixed and schema-to-grammar compilation is enabled for tool-calling, it would likely resolve this issue at the sampling level rather than relying on the model to follow written instructions.