ollama - ✅(Solved) Fix gemma4 does not support `description` as a tool parameter name [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15670Fetched 2026-04-19 15:04:29
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×1labeled ×1

Fix Action

Fix / Workaround

As a workaround I've renamed this property and after that it was able to call this tool.

PR fix notes

PR #15703: model/renderers/gemma4: allow reserved JSON Schema keys as parameter names

Description (problem / solution / changelog)

Problem

Any tool parameter named description, type, properties, required, or nullable is silently dropped from the rendered declaration sent to Gemma4 models. These are valid JSON Schema keywords but are also valid user-defined parameter names.

Root cause: writeSchemaProperties called isSchemaStandardKey() on parameter names, treating those strings as reserved. A tool with a description parameter would render properties:{propX:{...},propY:{...}} — the description property completely absent — while still listing it in required.

Fix

Remove the isSchemaStandardKey guard from the general property-name loop. The function is still applied in the one internal fallback path that passes a raw schema object (rather than a properties map) to writeSchemaProperties, where filtering out metadata keys is correct.

Test

Added reserved_schema_key_as_param_name to TestGemma4RendererMatchesReference. The test fails without the fix (reproduces the exact issue from the report) and passes with it. All 69 renderer tests pass.

Fixes #15670

Changed files

  • model/renderers/gemma4.go (modified, +7/-4)
  • model/renderers/gemma4_reference_test.go (modified, +29/-0)

Code Example

{
    parameters: {
        type: 'object',
        properties: {
            propX: {
                type: 'string',
                description: 'Lorem ipsum 1',
            },
            description: {
                type: 'string',
                description: 'Lorem ipsum 2',
            },
            propY: {
                type: 'string',
                description: 'Lorem ipsum 3',
            },
        },
        required: ['propX', 'description', 'propY'],
    }

---

{
    parameters: {
        type: 'object',
        properties: {
            propX: {
                type: 'string',
                description: 'Lorem ipsum 1',
            },
            propY: {
                type: 'string',
                description: 'Lorem ipsum 3',
            },
        },
        required: ['propX', 'description', 'propY'],
    }

---
RAW_BUFFERClick to expand / collapse

What is the issue?

Gemma4 can see that there is a required property description, but it will not see it in the properties field.

For example if I give it a tool with those parameters:

{
    parameters: {
        type: 'object',
        properties: {
            propX: {
                type: 'string',
                description: 'Lorem ipsum 1',
            },
            description: {
                type: 'string',
                description: 'Lorem ipsum 2',
            },
            propY: {
                type: 'string',
                description: 'Lorem ipsum 3',
            },
        },
        required: ['propX', 'description', 'propY'],
    }

It will tell me that it sees the tool defined with only those properties:

{
    parameters: {
        type: 'object',
        properties: {
            propX: {
                type: 'string',
                description: 'Lorem ipsum 1',
            },
            propY: {
                type: 'string',
                description: 'Lorem ipsum 3',
            },
        },
        required: ['propX', 'description', 'propY'],
    }

Tested on v0.21.0 with gemma4:31b and gemma4:26b models. I did not check the other gemma models.

Other models that I tested can see all parameters correctly.

As a workaround I've renamed this property and after that it was able to call this tool.

Relevant log output

OS

Windows

GPU

Nvidia

CPU

AMD

Ollama version

0.21.0

extent analysis

TL;DR

The issue can be worked around by renaming the description property in the tool parameters to avoid conflict with the reserved property name.

Guidance

  • The likely cause is a naming conflict between the description property in the tool parameters and a reserved property name.
  • To verify, try renaming the description property to a unique name and check if the issue persists.
  • To mitigate, rename the conflicting property to a different name, as the user has already done as a workaround.
  • Check if other models have the same issue to determine if it's a model-specific problem or a more general issue.

Example

No code snippet is provided as the issue is more related to configuration and property naming.

Notes

The issue seems to be specific to certain models (gemma4:31b and gemma4:26b) and not others, which might indicate a model-specific bug or limitation.

Recommendation

Apply workaround: rename the conflicting description property to avoid naming conflicts, as this has already been shown to resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - ✅(Solved) Fix gemma4 does not support `description` as a tool parameter name [1 pull requests, 1 comments, 2 participants]