[PR #11233] [MERGED] tools: fix parsing tool calls with empty arguments or missing required fields #18759

Closed
opened 2026-04-16 06:45:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11233
Author: @jmorganca
Created: 6/28/2025
Status: Merged
Merged: 6/30/2025
Merged by: @jmorganca

Base: mainHead: jmorganca/tool-calling-fixes


📝 Commits (1)

  • 3a38f7e tools: fix parsing tool calls with empty arguments, missing required fields

📊 Changes

2 files changed (+86 additions, -32 deletions)

View changed files

📝 tools/tools.go (+30 -20)
📝 tools/tools_test.go (+56 -12)

📄 Description

Tool call parsing was not correctly handling "arguments": {}, or considering required fields.

Fixes https://github.com/ollama/ollama/issues/11232


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/11233 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 6/28/2025 **Status:** ✅ Merged **Merged:** 6/30/2025 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `jmorganca/tool-calling-fixes` --- ### 📝 Commits (1) - [`3a38f7e`](https://github.com/ollama/ollama/commit/3a38f7e852543098913341801ae4d553d5f53964) tools: fix parsing tool calls with empty arguments, missing required fields ### 📊 Changes **2 files changed** (+86 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `tools/tools.go` (+30 -20) 📝 `tools/tools_test.go` (+56 -12) </details> ### 📄 Description Tool call parsing was not correctly handling `"arguments": {}`, or considering required fields. Fixes https://github.com/ollama/ollama/issues/11232 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 06:45:34 -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#18759