# Streaming responses with tool calling

DevFeed: [Streaming responses with tool calling](<https://devfeed.tech/articles/streaming-responses-with-tool-calling-83410.md>)

Original publisher: [Read original article](<https://ollama.com/blog/streaming-tool>)

Published: 2025-05-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ollama](<https://devfeed.tech/sources/ollama.md>)

Topics: [AI Chat](<https://devfeed.tech/topics/ai-chat.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [Ollama](<https://devfeed.tech/topics/ollama.md>), [Event-Streaming](<https://devfeed.tech/topics/event-streaming.md>), [AI-generated responses](<https://devfeed.tech/topics/ai-generated-responses.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [context-window](<https://devfeed.tech/tags/context-window.md>), [curl](<https://devfeed.tech/tags/curl.md>), [http](<https://devfeed.tech/tags/http.md>), [implementing](<https://devfeed.tech/tags/implementing.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [json](<https://devfeed.tech/tags/json.md>), [localhost](<https://devfeed.tech/tags/localhost.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-model-context-protocol](<https://devfeed.tech/tags/mcp-model-context-protocol.md>), [ollama](<https://devfeed.tech/tags/ollama.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [responses](<https://devfeed.tech/tags/responses.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [tool-calling](<https://devfeed.tech/tags/tool-calling.md>)

## AI overview

Ollama adds streamed responses that can issue tool calls while generating content. The article provides cURL, Python, and JavaScript examples, then explains an incremental parser that separates tool calls from regular content and discusses handling partial prefixes, fallback JSON parsing, and repeated tool-call detection. It also describes using tool calls with MCP and notes that longer context windows increase memory use.

## Source excerpt

Ollama now supports streaming responses with tool calling. This enables all chat applications to stream content and also call tools in real time.