Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tuhin PaulRank #7 · 71.9K reputationPosted Jun 10, 2026, 2:57 AM EDT
Compare Ollama as a brilliant scholar locked in a windowless library with books only up to 2023. If you ask about today's news, they can't answer. Tool Calling is like slipping a smartphone under the door. The scholar uses it to search the web, reads the results, and then writes you a perfect summary. simple ASP.NET Core Minimal API that uses Ollama Tool Calling to perform a web search.
Note: We mock the actual search API call to keep the code short, but I've marked exactly where you plug in Bing, DuckDuckGo, or Tavily.
How it Works (Step-by-Step for your slides)
The Setup: We define a
web_searchtool so Ollama knows it has the ability to search.The First Ask: We send the user's question to Ollama. Instead of answering, Ollama replies with a
tool_call(e.g., "I need to search for 'Latest AI news'").The Execution: Our C# code catches that request, executes the actual web search (via an API), and grabs the results.
The Final Answer: We send the web results back to Ollama. Ollama reads the raw web data and generates a clean, human-readable summary for the user.
"Internal Company Knowledge Bot"
Imagine a company uses SharePoint for documents, but it's hard to search. You can build an ASP.NET API where the "Tool" isn't the web, but an Internal SQL Database or SharePoint API. When an employee asks, "What is the policy on work-from-home?", Ollama triggers the tool, fetches the exact PDF text from the database, and summarizes it instantly! Not all models support tools! For this to work in Ollama, they must pull a tool-calling capable model like
llama3.1,mistral, orqwen2.5. Standardllama3(8B) will just ignore the tool definition.