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.
42 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.
The annoying part of running a blog isn't writing — it's choosing topics. So I wrote a minimal agent that runs on GitHub Actions, reads my existing posts weekly, and proposes 5 new topics. It's still just the loop: ask the model → run the tool → feed the result back. Reusable template included.
MCP mostly uses stdio not because pipes are superior, but because most current scenarios are the sweet spot for pipes: local, single client, one-shot, light and stateless. Once it becomes multi-client/always-on/stateful, switch to a socket.
MCP isn't magic: it's a JSON-RPC protocol that turns last post's hardcoded cat tool into a standalone process any LLM app can use. 30 lines of runnable server + client.
The MCP spec decides how the client is written. No server here — just 40 lines of stdlib for a standard MCP client: handshake → read capabilities → tools/list → tools/call. Works with any MCP server.
Strip away the frameworks and an agent is just a loop: call the API to ask the model → run the tool → feed the result back. One complete runnable example, using DeepSeek.
Subscribe via RSS to get new posts automatically.
Technical questions, feedback and leads: use the guestbook.