[GH-ISSUE #13031] Broken example in api.md #8633

Closed
opened 2026-04-12 21:22:24 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @gkjpettet on GitHub (Nov 9, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/13031

What is the issue?

The CURL example in api.md doesn't work because there are two superfluous commas. Additionally, in the messages history, the assistant calls a function named get_temperature.

In the tools definition (at the bottom), you are telling the model that the only available tool is named get_weather.

The corrected version should be:

curl http://localhost:11434/api/chat -d '{
  "model": "gpt-oss:120b",
  "messages": [
    {
      "role": "user",
      "content": "what is the weather in Toronto?"
    },
    {
      "role": "assistant",
      "content": "",
      "tool_calls": [
        {
          "function": {
            "name": "get_weather",  # <-- RENAMED
            "arguments": {
              "city": "Toronto"
            }
          }
        }
      ]
    },
    {
      "role": "tool",
      "content": "11 degrees celsius",
      "tool_name": "get_weather" # <-- RENAMED
    }
  ],
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather", # <-- MATCHES NOW
        "description": "Get the weather in a given city",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string",
              "description": "The city to get the weather for"
            }
          },
          "required": ["city"]
        }
      }
    }
  ]
}'

Relevant log output


OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.12.10

Originally created by @gkjpettet on GitHub (Nov 9, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/13031 ### What is the issue? The CURL example in `api.md` doesn't work because there are two superfluous commas. Additionally, in the messages history, the assistant calls a function named `get_temperature`. In the tools definition (at the bottom), you are telling the model that the only available tool is named `get_weather`. The corrected version should be: ``` curl http://localhost:11434/api/chat -d '{ "model": "gpt-oss:120b", "messages": [ { "role": "user", "content": "what is the weather in Toronto?" }, { "role": "assistant", "content": "", "tool_calls": [ { "function": { "name": "get_weather", # <-- RENAMED "arguments": { "city": "Toronto" } } } ] }, { "role": "tool", "content": "11 degrees celsius", "tool_name": "get_weather" # <-- RENAMED } ], "stream": false, "tools": [ { "type": "function", "function": { "name": "get_weather", # <-- MATCHES NOW "description": "Get the weather in a given city", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "The city to get the weather for" } }, "required": ["city"] } } } ] }' ``` ### Relevant log output ```shell ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.12.10
GiteaMirror added the bug label 2026-04-12 21:22:24 -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#8633