PromptisePromptise
Docs
GitHub
Promptise - AI Framework LogoPromptise

The foundation layer for agentic intelligence. Build, secure and operate autonomous AI systems with Promptise Foundry.

pip install promptise

[01] Foundry

  • MCPcast
  • The Promptise Agent
  • Reasoning Engine
  • MCP
  • Agent Runtime
  • Prompt Engineering
  • Execution Engine
  • Agent Identity

[02] Resources

  • Documentation
  • GitHub
  • Guides
  • Learning Paths
  • Questions

[03] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

Open source · Python

← Guides> Library> Topic

Tool calling for LLMs and AI agents

Tool calling, also called function calling, is how a language model asks your program to do something it cannot do by generating text: query a database, call an API, run a calculation. You describe each tool with a name, a description and a JSON schema for its arguments. The model replies with a structured call, your code runs it and returns the result, and the model continues.

The hard parts are in the details: writing descriptions the model understands, validating arguments before anything runs, keeping the tool list short enough that the model picks the right one, and streaming or tracing calls so you can see what happened. These guides cover tool calling from a first agent to planning multi-step calls, approving risky ones and connecting tools over MCP.

[n.01/02]> 16 guides
  1. 01What Is MCP (Model Context Protocol)? A Developer's GuideWhat MCP is and how it works: hosts, clients, servers, tools, resources, transports and SDK 2.x. Build a small MCP server and connect an agent to it.Beginner · 18 minOct 18, 2026
  2. 02What Is an AI Agent? Definition, How It Works, ExamplesWhat an AI agent is: a model that calls tools in a loop until a goal is met. How the loop works, a real example, agents vs chatbots and workflows, FAQs.Beginner · 7 minOct 18, 2026
  3. 03What Is Tool Calling? LLM Function Calling ExplainedWhat tool calling (function calling) is: how an LLM asks your code to run a function, the JSON schema it sees, parallel calls, and how it differs from MCP.Beginner · 7 minOct 18, 2026
  4. 04How to Build an AI Agent in Python (2026 Guide)Build an AI agent in Python step by step: write the tool loop, serve tools over MCP, add model fallback, approvals and limits. Runnable code, real output.Beginner · 20 minOct 18, 2026
  5. 05How to Connect MCP Servers to Your AI Agent in PythonGive your AI agent real tools with the Model Context Protocol. Connect local and remote MCP servers to a Python agent, step by step, with code you can run.Beginner · 12 minOct 11, 2026
  6. 06Why Can't LLMs Count Letters? Tokens and ProbabilityWhy LLMs miscount letters, reverse strings wrong and miss word limits: tokenization, sampling, real failures, and why exact work belongs in your code.Beginner · 4 minOct 18, 2026
  7. 07MCP vs CLI for AI Agents: Tokens, Security, When to Use EachMCP vs CLI tools for AI agents: where the tokens go, prompt caching, per-user security and when to use each or both, with runnable code and real output.Intermediate · 20 minOct 18, 2026
  8. 08Streaming LLM Responses with FastAPI: Tokens and Tool CallsStream an AI agent's tool calls and answer from FastAPI to a web page with Server-Sent Events, with cancellation, errors and an EventSource page.Intermediate · 14 minOct 11, 2026
  9. 09Too Many MCP Tools? LLM Tool Selection, MeasuredWhat 122 tools do to an LLM agent's accuracy, tokens and latency, measured, and how semantic tool selection fixes it in Python, with honest limits.Intermediate · 18 minOct 11, 2026
  10. 10AI Agent Observability: Trace Tool Calls, Tokens and CostTrace every LLM call and tool call your AI agent makes, with tokens, latency and cost, then use the trace to find the exact step that went wrong.Intermediate · 18 minOct 11, 2026
  11. 11Best LLM for AI Agents: Test and Switch Models in PythonFind the best LLM for your AI agent with a tool-calling eval, then switch between OpenAI, Anthropic, Azure, Bedrock, Gemini and Ollama in one line.Intermediate · 22 minOct 11, 2026
  12. 12AI Agent Human in the Loop: Approve Tool Calls in PythonMake your AI agent ask a human before it refunds, emails or deletes. Approve or reject tool calls in Python, with real runs and honest limits.Intermediate · 20 minOct 11, 2026
  13. 13How LLM Tool Calling Works: The Model Never Runs ToolsHow LLM tool calling works: the model writes a request, your code runs it. A real two-step refund exchange and design rules for tools, results and gates.Intermediate · 4 minOct 18, 2026
  14. 14ReAct Agent From Scratch in Python: The Reason-Act LoopBuild a ReAct agent from scratch in Python: the Thought, Action, Observation loop, a 60-line controller with a real trace, and how it maps to tool calling.Intermediate · 8 minOct 18, 2026
  15. 15Program-of-Thought in Python: Run Model Code SafelyCompute answers with model-written code in Python: an output contract, a locked-down Docker sandbox, a two-run check, and when to use a code tool instead.Advanced · 8 minOct 18, 2026
  16. 16LLM Tool Call Planning: Validate Plans Before ExecutingHave the LLM plan multi-step API calls as JSON, validate tools, arguments and guards in code, then execute safely. Python code and a real plan that failed.Advanced · 8 minOct 18, 2026
[n.02/02]> go further

Related topics

  • Model Context Protocol (MCP)37
  • Agent Loop4
  • Cost Control9
  • Human-in-the-Loop6
  • LLM Mental Models19
  • Code Execution and Sandboxing3
  • Evals and Testing15
  • Guardrails9

Topic hubs

  • Tools and the Model Context Protocol (MCP)→
  • Building AI agents in Python→
  • Cost control and rate limits→
  • Frameworks and comparisons→

By category and level

  • AI Engineering guides71
  • Prompt Engineering guides54
  • Beginner guides36
  • Intermediate guides80
  • Advanced guides24

Search every guide.

The library lists all guides with filters for topic, level, category and reading time.

All guidesLearning paths