Function Calling Explained: one diagram is enough
The model doesn't call your functions — it only outputs a structured 'call this tool with these args', and your code runs it. One diagram + 30 lines to make function calling click.
10 posts
The model doesn't call your functions — it only outputs a structured 'call this tool with these args', and your code runs it. One diagram + 30 lines to make function calling click.
Run an agent for a while and the messages array balloons: token cost explodes, it gets slow, and eventually it overflows the context window. Not a small issue — the #1 engineering problem in production agents. 6 fixes + runnable code.
The most hidden performance killer in agents: a tool returns a pile of logs/files and you paste it straight back into context — tokens explode, it gets slow, and the model drowns. The real fix is on the tool side: make it a query port, not a printer.
Most people get stuck on MCP's Host / Client / Server trio: 'Aren't I supposed to write a client? But I only see people writing a server, and opencode / Cursor just connect and work.' The truth: the client is always there — it's tucked inside the host, transparent to you.
Subscribe via RSS to get new posts automatically.
Technical questions, feedback and leads: use the guestbook.