The anatomy of an agent framework: loop, tools, MCP, and structured output
Strip away the branding and every agent framework assembles the same few parts: an agent loop, tool calling, a way to connect tools (increasingly MCP), and structured outputs. Here's how they fit.
Agent frameworks differ on the surface, but underneath they orchestrate the same handful of primitives. Learn these five and you can read any framework — and, more usefully, debug one when it misbehaves instead of treating it as magic.
The agent loop
This is the engine. The model reasons about the goal, decides whether to call a tool, the tool runs, its result is fed back into the context, and the loop repeats until the model produces a final answer. Everything else exists to make this loop reliable and bounded — and it must be bounded, so always cap the iterations.
Tool calling
Tool calling is how the model reaches beyond text. You describe each tool with a name, a description, and a parameter schema; the model emits a structured request to call one; your code executes it and returns the result. This is the mechanism that turns a chatbot into something that can actually act.
Structured outputs
Reliable tool calling and reliable agents both rest on structured output — the model returning JSON that matches a schema instead of prose. It's how a tool request is parsed unambiguously, and how an agent's result feeds cleanly into the next system. Without it, the loop is one malformed response away from falling over.
MCP — the Model Context Protocol
Historically every framework wired up tools its own way, so nothing was reusable. MCP, an open standard, fixes that: it's a common protocol — think 'USB-C for tools and data' — for exposing tools, data, and prompts to any model or agent. Build an MCP server once, and any MCP-aware client can use it. That reusability is why frameworks are rapidly converging on it.
Orchestration
Above a single loop sits orchestration: sequencing multiple steps or agents, routing, running work in parallel, handoffs, and carrying state across a longer task. Lightweight SDKs give you just enough of this to get by; orchestration frameworks like LangGraph and CrewAI make it their whole reason to exist.
- Agent loop — reason, act, observe, repeat; always bounded.
- Tool calling — schema'd requests your code executes and returns.
- Structured outputs — schema-valid JSON that makes tools and results parseable.
- MCP — an open standard so tools plug into any agent.
- Orchestration — coordinating steps, agents, and state above the loop.
Frameworks are branding over the same five parts. Understand the loop, tools, structured output, MCP, and orchestration, and every one of them stops being a black box.