PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

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

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← 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.

34
guides
8
Beginner
23
Intermediate
3
Advanced
9 h
of reading

Featured · start here

ReAct Agent From Scratch in Python: The Reason-Act Loop

Build 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 minRead the guide →

33 guides

  1. 01ReAct Agent Pattern: Tool Execution Loop Explained SimplyThe ReAct agent pattern explained simply: what an agent does after it calls a tool, a loop written by hand, the same agent in Promptise, where it breaks.Beginner · 14 minBuilding AI agents in PythonBeginner · 14 minBuilding AI agents in Python→
  2. 02LangChain vs MCP: Differences and How They Work TogetherLangChain vs MCP: MCP is a protocol that serves tools, LangChain is an agent framework. How they differ, when to use each, and a runnable MCP agent.Beginner · 16 minTools and the Model Context Protocol (MCP)Beginner · 16 minTools and the Model Context Protocol (MCP)→
  3. 03What 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 minTools and the Model Context Protocol (MCP)Beginner · 18 minTools and the Model Context Protocol (MCP)→
  4. 04What 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 minBuilding AI agents in PythonBeginner · 7 minBuilding AI agents in Python→
  5. 05What 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 minTools and the Model Context Protocol (MCP)Beginner · 7 minTools and the Model Context Protocol (MCP)→
  6. 06How 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 minBuilding AI agents in PythonBeginner · 20 minBuilding AI agents in Python→
  7. 07How 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 minTools and the Model Context Protocol (MCP)Beginner · 12 minTools and the Model Context Protocol (MCP)→
  8. 08Why 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 minPrompt EngineeringBeginner · 4 minPrompt Engineering→
  9. 09Tool Parameters Array Type Must Have Items: The FixFix the tool parameters array type must have items error: why VS Code and strict providers reject MCP tool schemas, and how to fix and test them.Intermediate · 12 minTools and the Model Context Protocol (MCP)Intermediate · 12 minTools and the Model Context Protocol (MCP)→
  10. 10Scheduled AI Agent With Push Notifications (ntfy, Pushover)Build a scheduled AI agent with push notifications: a cron trigger, a notify tool for ntfy or Pushover, budgets, and alerts only when something changed.Intermediate · 18 minRuntime, triggers and deploymentIntermediate · 18 minRuntime, triggers and deployment→
  11. 11Tool Result Too Large? Keep an AI Agent's Context SmallTool result too large for your AI agent? Page, filter and count at the tool, return errors instead of rows, and see what each design costs in tokens.Intermediate · 16 minMemory, context and RAGIntermediate · 16 minMemory, context and RAG→
  12. 12AI Agent Approval Timeouts: Fail Closed, Default DenyWhat should happen when nobody approves an AI agent's tool call? Deny on timeout, never cache consent, bind each approval to one call, escalate in time.Intermediate · 18 minHuman approvals (human-in-the-loop)Intermediate · 18 minHuman approvals (human-in-the-loop)→
  13. 13Idempotent Tool Calls: Make AI Agent Retries SafeIdempotent tool calls make AI agent retries safe: where retries come from, why timeouts duplicate actions, and how to add idempotency keys, with real code.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  14. 14Vectorless RAG: Tree Search Over Long DocumentsVectorless RAG explained: how tree search over a document outline replaces vector search, when it beats embeddings and when not, with a runnable agent.Intermediate · 18 minMemory, context and RAGIntermediate · 18 minMemory, context and RAG→
  15. 15Source Provenance for Research Agents: Track Each ClaimSource provenance for research agents: tie every claim to a source the agent read and an exact quote, check it in code, and stop fake statistics.Intermediate · 16 minMemory, context and RAGIntermediate · 16 minMemory, context and RAG→
  16. 16Hidden Text Prompt Injection: Sanitize Pages for AI AgentsStop hidden text prompt injection: strip CSS-hidden text, comments and invisible characters from web pages, scan what is left, and limit agent tools.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  17. 17AI Agent Tool Failures: Stop Unsafe WorkaroundsWhen a tool fails, AI agents improvise and reach the same data another way. Stop unsafe workarounds with clear errors, narrow tools and deny rules.Intermediate · 16 minTools and the Model Context Protocol (MCP)Intermediate · 16 minTools and the Model Context Protocol (MCP)→
  18. 18Stop Secrets Leaking Into LLM Logs and TracesHow API keys and tokens end up in LLM logs and traces, and how to redact them from tool results, observability and log lines before anything is stored.Intermediate · 18 minGuardrails and securityIntermediate · 18 minGuardrails and security→
  19. 19Agent Skills vs MCP Tools: When to Use EachAgent Skills vs MCP tools: what SKILL.md skills and MCP servers are, how each uses context and permissions, when to use which, and an agent using both.Intermediate · 16 minTools and the Model Context Protocol (MCP)Intermediate · 16 minTools and the Model Context Protocol (MCP)→
  20. 20Small Local Models for Tool Calling: What BreaksWhy small local models fail at tool calling: templates, parser bugs, short context, bad arguments and loops, with a fix for each and a runnable replay.Intermediate · 18 minModels and providersIntermediate · 18 minModels and providers→
  21. 21Make Your SaaS Agent-Ready: MCP, OpenAPI or BothMake your SaaS agent-ready: when to ship an MCP server, an OpenAPI spec or both, what to expose to agents, how auth works, and a runnable example.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  22. 22Best Local LLM for AI Agents: Ollama Models by GPU (2026)The best local LLM for AI agents by GPU size: Ollama models that call tools well, VRAM and context needs, LM Studio and vLLM setup, and the pitfalls.Intermediate · 20 minModels and providersIntermediate · 20 minModels and providers→
  23. 23AI-Based PII Detection and Redaction Tools for LLM AppsAI-based PII detection and redaction for LLMs: regex, NER, Presidio, cloud DLP and LLM detectors compared, with code to mask prompts, tool output and logs.Intermediate · 20 minGuardrails and securityIntermediate · 20 minGuardrails and security→
  24. 24MCP 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 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→
  25. 25Streaming 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 minBuilding AI agents in PythonIntermediate · 14 minBuilding AI agents in Python→
  26. 26Too Many MCP Tools? How to Fix LLM Tool Selection in PythonToo many MCP tools cost tokens and lead an LLM agent to the wrong one. Learn how semantic tool selection works, how to check it offline and how to tune it.Intermediate · 18 minTools and the Model Context Protocol (MCP)Intermediate · 18 minTools and the Model Context Protocol (MCP)→
  27. 27AI 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 minObservability and debuggingIntermediate · 18 minObservability and debugging→
  28. 28Best LLM for AI Agents (2026): Picks, Prices, How to TestThe best LLM for AI agents in 2026 by use case, from public agent benchmarks and vendor prices, why the boards disagree, and how to test models yourself.Intermediate · 20 minBuilding AI agents in PythonIntermediate · 20 minBuilding AI agents in Python→
  29. 29AI Agent Human in the Loop: Approve Tool Calls in PythonAdd human-in-the-loop approval to an AI agent in Python: a person approves, rejects or edits each refund, email or delete before the tool runs.Intermediate · 20 minTools and the Model Context Protocol (MCP)Intermediate · 20 minTools and the Model Context Protocol (MCP)→
  30. 30How 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 minPrompt EngineeringIntermediate · 4 minPrompt Engineering→
  31. 31Policy as Code for AI Agent Tool Calls: OPA vs ApprovalPolicy as code for AI agent tool calls: when deterministic rules beat human approval or model judgment, and how to check each call with OPA before it runs.Advanced · 20 minHuman approvals (human-in-the-loop)Advanced · 20 minHuman approvals (human-in-the-loop)→
  32. 32Program-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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→
  33. 33LLM 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 minPrompt EngineeringAdvanced · 8 minPrompt Engineering→

Related topics

  • Model Context Protocol (MCP)54
  • Guardrails22
  • Human-in-the-Loop27
  • Cost Control29
  • Observability24
  • Agent Loop7
  • Context Engineering12
  • Model Selection and Routing21

Topic hubs

  • Tools and the Model Context Protocol (MCP)→
  • Building AI agents in Python→
  • Frameworks and comparisons→
  • Models and providers→

By category and level

  • AI Engineering guides147
  • Prompt Engineering guides54
  • Beginner guides75
  • Intermediate guides140
  • Advanced guides38

Search every guide.

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

All guidesLearning paths