Resources / AI agents

AI agents and tool calling, explained

What an AI agent is, how tool calling works under the hood, and what it takes to give an agent tools that do real work.

An AI agent is a language model in a loop: it reads a goal, decides on an action, takes it with a tool, looks at the result, and repeats until the goal is met. Tools are what turn a chatbot into something that does work.

How tool calling works

  1. Your application sends the model a conversation plus a list of tools — each with a name, a description and an input schema.
  2. The model answers either with text or with a tool call: a tool name and arguments as JSON.
  3. Your application runs the tool and sends the result back.
  4. The model continues — another tool call, or a final answer.

The model never runs anything itself. It proposes calls; your code (or an MCP client) executes them.

Where MCP fits

Without a standard, every app defines tools its own way. The Model Context Protocol lets you build tools once as a server, and any MCP-capable client — Claude, ChatGPT, Cursor, your own agent — can discover and call them.

What makes agents work well

Where agents struggle

Long chains of steps compound small errors. Ambiguous tools get misused. Untrusted text can steer the agent (prompt injection). Keep humans in the loop for decisions that matter.

Building tools without servers

A tool is just an HTTP endpoint with a schema. With Wisp you describe it in a sentence, and it's deployed as an endpoint and an MCP tool at once.

Build it with Wisp — describe an API, get it live.

Related