[GH-ISSUE #5976] Unnecessary quotes when calling a tool #65773

Open
opened 2026-05-03 22:38:01 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @napa3um on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5976

What is the issue?

I'm using mistral-nemo:12b-instruct-2407-q4_1

I'm trying to reproduce this example - https://github.com/ollama/ollama-js/blob/main/examples/tools/tools.ts

tools: [
            {
                type: 'function',
                function: {
                    name: 'eval',
                    description: 'Вычисляет арифметическое выражение в формате JS-функции eval. Используется тогда, когда нужен калькулятор.',
                    parameters: {
                        type: 'object',
                        properties: {
                            expression: {
                                type: 'string',
                                description: 'Арифметическое выражение',
                            }
                        },
                        required: ['expression'],
                    },
                },
            },
        ],

Everything works, but sometimes I get (without a space between the quotes):

The model didn't use the function. Its response was:
``⠀`
{
  "jsonrpc": "2.0",
  "method": "eval",
  "params": {
    "expression": "5234 / 6453 * 23456"
  }
}
``⠀`

That is, sometimes the model wraps JSON in triple quotes, and Ollama interprets this as a text response rather than a tool call.

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.3.0

Originally created by @napa3um on GitHub (Jul 26, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5976 ### What is the issue? I'm using **mistral-nemo:12b-instruct-2407-q4_1** I'm trying to reproduce this example - https://github.com/ollama/ollama-js/blob/main/examples/tools/tools.ts ```javascript tools: [ { type: 'function', function: { name: 'eval', description: 'Вычисляет арифметическое выражение в формате JS-функции eval. Используется тогда, когда нужен калькулятор.', parameters: { type: 'object', properties: { expression: { type: 'string', description: 'Арифметическое выражение', } }, required: ['expression'], }, }, }, ], ``` Everything works, but sometimes I get (without a space between the quotes): ``` The model didn't use the function. Its response was: ``⠀` { "jsonrpc": "2.0", "method": "eval", "params": { "expression": "5234 / 6453 * 23456" } } ``⠀` ``` That is, sometimes the model wraps JSON in triple quotes, and Ollama interprets this as a text response rather than a tool call. ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.3.0
GiteaMirror added the bug label 2026-05-03 22:38:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65773