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
- Your application sends the model a conversation plus a list of tools — each with a name, a description and an input schema.
- The model answers either with text or with a tool call: a tool name and arguments as JSON.
- Your application runs the tool and sends the result back.
- 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
- Good tools. Clear names, descriptions and schemas. See Designing MCP tools.
- Small, reliable steps. Tools that do one thing and return clean results.
- Feedback. Errors that tell the model what to do next.
- Guardrails. Limits and confirmations for anything consequential.
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.