Deva Annamaraju
← All notes

Jan 2026 · 11 min read

building developer tools for llms

llm tooling has moved past simple api wrappers. function calling, mcp servers, structured outputs and agent frameworks all changed how we build. this is how i see the tooling today.

  • LLMs
  • MCP
  • Developer Tools

three years ago, "llm tooling" meant an api wrapper with a retry loop and maybe a prompt template string. you'd call openai's completions endpoint, parse the freeform text response with a regex, and hope for the best. the whole stack fit in one file.

today there are dedicated protocols for tool interoperability, structured output guarantees baked into the api layer, agent frameworks with their own state machines and memory systems, and an entire observability ecosystem just for tracing what an llm agent did and why. i think the tooling around the models has gotten more interesting than the models themselves, and it's where most of the useful work is now. a hypothetical jump from 400b to 800b parameters matters less to me than the infrastructure that turns a raw model into something you can ship.

let me trace how we got here, because the timeline is compressed enough that it's easy to lose track.

early 2023 was the prompt engineering era. the state of the art was "write a better system prompt." people were sharing jailbreaks on twitter and the most sophisticated technique was chain-of-thought: just tell the model to think step by step. the tools were chatgpt and a text box. if you wanted to build something production-grade, you were mostly on your own.

mid 2023 brought the first wave of frameworks. langchain and llamaindex had both shipped in late 2022, and by mid 2023 they were trying to be the react.js of llm applications. langchain in particular became the default, which was both good (it existed) and bad (it was deeply over-abstracted for what most people needed). the core idea was right though: you need a layer between your application and the raw model api.

function calling landed in the middle of all that. openai shipped it on june 13, 2023, and i'd call it the most important api change in this whole timeline. instead of the model outputting freeform text that you had to parse, it could output a structured json object describing a function it wanted you to invoke. i'll come back to why this distinction matters so much.

2024 was agents and structured outputs. google got there first, adding json schema mode to the gemini api in may 2024. openai shipped strict json schema conformance in august 2024. anthropic took longest: its structured outputs only arrived as a public beta in november 2025. agent frameworks matured from "cool demo" to "thing you could maybe put in production if you squinted." the eval ecosystem exploded. anthropic also published the model context protocol spec in november 2024, to not much fanfare.

2025 brought mcp adoption, a pile of new agent frameworks, and the first observability tooling i'd call real. 2026 looks like it's about production-grade agent infrastructure: the unglamorous pieces that make this stuff run reliably.

~2,000
entries in the official mcp registry, nov 2025
6
agent frameworks named in this post, out of many
$0.03
per 1m cached text input tokens, gemini 2.5 flash (plus storage)
2M
token context window, gemini 1.5 pro, opened to all devs jun 2024

the model doesn't call anything

i think this is the most misunderstood concept in llm tooling, and getting it wrong leads to bad architecture decisions. when people say a model "calls a function" or "uses a tool," what happens is that the model outputs a json object containing a function name and arguments. your runtime code reads that json, executes the function, and feeds the result back into the model's context for the next turn. the model does none of that part.

the model never runs code, touches your database, or makes an http request. it produces text, specifically structured text describing what it wants to happen. this matters because, from the model's side, a tool is only a description it reasons about. it reads the tool's name, its description, and its parameter schema, then decides whether and how to invoke it based on that text. so if a tool is described badly, the model will misuse it, no matter how well the function behind it is implemented.

tool-call.ts
// what the model actually outputs (it's just text):
{
  "tool_calls": [{
    "id": "call_abc123",
    "type": "function",
    "function": {
      "name": "query_database",
      "arguments": "{\"sql\": \"SELECT * FROM users WHERE active = true LIMIT 10\"}"
    }
  }]
}

// your runtime does the actual work:
const assistantMessage = response.choices[0].message;
const toolCall = assistantMessage.tool_calls[0];
const result = await executeTool(toolCall.function.name, JSON.parse(toolCall.function.arguments));

// then you feed the call and its result back into the conversation:
messages.push(assistantMessage);
messages.push({
  role: "tool",
  tool_call_id: toolCall.id,
  content: JSON.stringify(result)
});

// and call the model again with the updated context
const finalResponse = await openai.chat.completions.create({ model, messages, tools });

a lot of tutorials gloss over what follows from this: the tool execution loop is your code. you control what happens between the model's request and its next turn, so you can validate the arguments, rate-limit calls, inject additional context, log everything, or reject the call entirely. the model makes suggestions and your runtime decides what runs. the best llm applications i've seen treat this boundary as their main control surface, more than the system prompt.

mcp as a protocol

i'd argue the model context protocol is the most consequential thing anthropic has shipped for developers, and most explanations of it are either too vague ("it's like usb for ai!") or too deep in the spec to be useful. this is the version that would have saved me a few hours.

mcp is a json-rpc 2.0 protocol. it defines a communication contract between three things: a host (the application running the llm, like claude desktop or your custom agent), a client (managed by the host, maintains a 1:1 connection to a server), and a server (a process that exposes tools, resources, and prompts). the server is where your functionality lives. it could be a filesystem accessor, a database connector, a github integration, or anything else you want an llm to interact with.

diagram 01: mcp architecture
HOST APPLICATION llm (claude, gpt) mcp client mcp client json-rpc mcp server A filesystem tools: read_file, write_file mcp server B database tools: query, insert local disk or remote api postgres, sqlite or any data store each client ↔ server connection is 1:1. the host manages multiple clients.
fig 01: the host (your app) manages mcp clients, each connected to one server. servers expose tools via json-rpc. the llm never talks to servers directly; it reasons about tool descriptions and the runtime handles execution.

before mcp, every integration was bespoke. if you wanted claude to query your database, you wrote a custom tool for claude. if you wanted gpt-4 to do the same thing, you wrote a different custom tool shaped for openai's function calling format. if you wanted to switch models, you rewrote your tools. with mcp you build the server once, describe your tools once, and any compliant host can connect to it. so the "usb" analogy holds up better than it sounds. peripherals existed before usb, and what usb added was interchangeability.

you can already see the effect. cursor, windsurf, claude code, and other coding tools all support mcp servers, so you can install a postgres mcp server and any of them can query your database without you writing a line of integration code. we went from "two weeks to build a custom integration" to "npm install and a config file."

structured outputs changed more than people noticed

something happened between may 2024 and november 2025 that didn't get the attention it deserved: google, openai, and anthropic all shipped some form of guaranteed structured output. you give the model a json schema and its output is guaranteed to conform to it, enforced at the decoding level, which is a much stronger promise than "usually conforms" or "conforms if you ask nicely in the prompt."

before this, the standard approach was to ask for json in the system prompt, hope the model complied, and wrap the whole thing in a try-catch. production systems carried elaborate retry logic for malformed json. i've seen codebases with whole files dedicated to "parse the llm output and handle the seventeen ways it might be broken." all of that became unnecessary more or less overnight.

the bigger impact was second-order, though. reliable function calling depends on guaranteed structured output: if the model can't guarantee valid json, it can't guarantee valid function arguments, and your tool execution layer has to handle arbitrary malformed input. once outputs are guaranteed, you can trust the contract between the model and your tools and build on it, instead of stacking up defensive workarounds.

↳ the underrated shift

i think the move from "parse freeform text" to "guaranteed schema conformance" is the biggest reliability improvement llm applications have had. it doesn't get talked about much, probably because infrastructure rarely does, but function calling, tool use, agent loops and mcp all rely on the model producing valid structured output.

the technique behind this is called constrained decoding. at each token generation step, the model's output distribution is masked so that only tokens which would keep the output valid according to the schema are considered. the model doesn't get a say in this. the runtime filters its probability distribution before sampling, so invalid json can't come out, short of a refusal or the response getting cut off at the token limit. that means you can give a model a union type schema with five variants and it will always produce exactly one valid variant, and you can enforce enum values and required fields the same way. how much of json schema you get beyond that depends on the provider: anthropic's version, for one, rejects numeric constraints like minimum and maximum.

for agent architectures, this is what makes the tool-call loop deterministic enough to build on. without it, every agent framework would be stuck doing fuzzy text parsing; with it, you get typed interfaces between the model and your code.

agent frameworks and how they differ

from the outside, the set of agent frameworks looks chaotic: langgraph, crewai, autogen, vercel ai sdk, openai agents sdk, google adk, and it feels like a new one shows up every month. they are making different architectural bets, though, and knowing which bet each one makes helps when you're picking one.

langgraph (from the langchain team) models agents as state machines. you define nodes (functions that transform state), edges (transitions between nodes), and a state object that persists across steps. the graph is explicit and inspectable. you can draw the exact flow your agent will follow. this is good when you need deterministic control flow: "first search, then analyze, then draft, then review." the tradeoff is verbosity: even a simple agent written as a custom langgraph graph needs a typed state class, node functions, edge logic, and a graph compilation step, which is a lot of ceremony for "call the model in a loop."

crewai takes a different approach: role-based multi-agent collaboration. you define agents with roles ("researcher," "writer," "critic"), give each a backstory and goal, then define tasks and assign them. the agents coordinate through a manager agent or sequentially. the abstraction is designed for workflows where you want simulated specialization. the bet is that giving the model a persona produces better output on specific sub-tasks. i'd say the evidence for that is mixed, but the framework itself is clean.

autogen (microsoft) models agents as participants in a conversation. the core primitive is a group chat where multiple agents take turns. the routing logic decides who speaks next based on context. it's designed for problems where back-and-forth refinement matters: code generation where one agent writes and another reviews, or research where one agent gathers evidence and another critiques it. so the architecture is built around conversation more than procedure. (in october 2025 microsoft announced microsoft agent framework, which folds autogen and semantic kernel into one framework, so new projects are being pointed there.)

vercel ai sdk is doing something different from all of these. i'd describe it as a streaming ui toolkit that happens to support tool calling and multi-step generation, more than an "agent framework" in the usual sense. its first take on this was streamUI, a react server components api that let the model answer with components directly, but vercel now labels that rsc api experimental and recommends ai sdk ui for production. there, each tool call arrives as a typed part of the message that useChat streams to the client, and you render each part as a component: a loading spinner while the call is in flight, then a chart once the output lands. vercel is betting that agents are mostly ui products and that the framework should be built around that.

diagram 02: agent architecture patterns compared
SINGLE-AGENT LOOP (vercel ai sdk, openai agents sdk) user input llm tool execution loop response STATE MACHINE (langgraph) search analyze draft escalate output explicit edges, typed state conditional branching MULTI-AGENT (crewai, autogen) agent researcher agent writer agent critic shared context agents negotiate via conversation or task hand-off
fig 02: the single-agent loop (left) is simple and covers most use cases. state machines (center) add explicit control flow, and multi-agent setups (right) add specialization through role-based agents that talk to each other. pick the simplest pattern that works.

my opinion: most applications should use the single-agent loop, meaning one model and a set of tools, looping until it's done. multi-agent and state machine patterns are useful for specific problems, but they get used far more often than they should. i've watched teams build elaborate multi-agent systems with a "planner" agent and an "executor" agent and a "reviewer" agent when a single model with good tools and a clear system prompt would have done the same job with a fraction of the complexity and the token cost. the coordination overhead of multiple agents is real, and i don't think it's worth paying unless you're dealing with adversarial sub-tasks or need to enforce separation of concerns at the architectural level.

the exception is code generation, where a separate "reviewer" agent that only sees the diff and checks for bugs does catch errors the writing agent misses. that's a real multi-agent win, and a fairly narrow one.

rag (retrieval augmented generation) deserves a mention here, since it's one of the most deployed patterns and also one of the most poorly implemented. the idea is that instead of relying on the model's training data, you retrieve relevant documents from your own corpus and inject them into the context window alongside the user's question, so the model answers from your data instead of what it memorized.

the naive implementation (embed everything into vectors, do a cosine similarity search, stuff the top 5 results into the prompt) fails in predictable ways. the embedding model might not capture the right notion of "relevance" for your domain. the chunks might be too big (wasting context) or too small (losing coherence). the top 5 most similar results might all say the same thing, giving you redundancy instead of coverage. and the model might ignore the retrieved context entirely if it conflicts with its pretraining.

what people call "advanced rag" is mostly the set of fixes for these failures. re-ranking: use a cross-encoder model to re-score the retrieved results based on actual query-document relevance, not just embedding similarity. hybrid search: combine vector similarity with keyword matching (bm25) because sometimes the user is searching for a specific term and cosine similarity misses it. chunk optimization: experiment with chunk sizes, add overlap between chunks, include metadata like document titles and section headers. query decomposition: break complex questions into sub-queries and retrieve for each one separately. none of this is exotic, and in my experience rag doesn't hold up in production without it.

↳ the observability gap

a made-up example to show the shape of it: say an agent makes 14 tool calls across 6 turns, spends $0.47 in api costs, takes 23 seconds, and returns a wrong answer. the bad step could have been the retrieval, the tool arguments, or a hallucinated intermediate result, and without agent-level observability (traces that show every step, every tool call, every context window state) you find out by reading logs and guessing. tools like langsmith, helicone, braintrust, and arize phoenix exist because this problem is real, and it gets worse as agents get more autonomous. my guess is that agent observability ends up as important as application performance monitoring was for web services in the 2010s.

the vocabulary is shifting too, which says something about the field growing up. people say "prompt engineering" less and "context engineering" more, which is more honest about the work: the prompt is one input among many, next to tool definitions, retrieved documents and conversation history, and the job is deciding what the model sees at each step. "context window" has gone from a spec number to a resource you manage, a bit like memory in systems programming, where you budget it and decide what goes in and what gets evicted. "inference-time compute" is a first-class concept now too, meaning you can spend more compute per query (via chain-of-thought, multiple passes, or tool loops) to get better answers, trading cost for quality at serving time rather than training time.

the term i'd pay most attention to is "tool schemas." the description and parameter schema you write for a tool are the interface the model reasons about, so they deserve more care than you'd give documentation. i've watched a tool go from regularly misused to reliably called just by rewriting its description from "queries the database" to "executes a read-only sql select query against the users table. returns rows as json arrays. does not support mutations. use the filter parameter to add where clauses." anthropic reports the same effect at a bigger scale: it says claude 3.5 sonnet reached state-of-the-art on swe-bench verified after precise refinements to its tool descriptions. since then i treat the description as the api contract.

if you're building in this space right now, my read is that most of the value sits in three layers: the tool execution runtime (how you manage the loop between model and tools), the context management layer (what goes into the model's context window and when), and observability (how you know what happened and why). the model itself is increasingly a commodity. gpt-5, claude sonnet 4.5, and gemini 3 pro are all good enough for most applications, so what sets a product apart is what you build around them.

there's an irony here i think about a lot. the companies that capture the most value from llms probably won't be the ones training the models. i expect it to be the ones building the infrastructure that makes the models useful: the tool runtimes, the agent frameworks, the observability platforms, the context management systems. a lot of "ai companies" turn out to be infrastructure companies when you look at what they ship. if the model is the engine, people buy the car for the steering, the brakes, the navigation and the fact that it starts every morning at least as much as for the engine.

my rough guess is we're maybe 30% of the way through figuring out what good llm infrastructure looks like. the tools we're building today will probably look as primitive to the 2028 version of this ecosystem as curl-based api calls look to us now. the problems underneath them are going to stick around, though: how to give models reliable access to the outside world, how to guarantee structured communication between systems, how to observe and debug non-deterministic multi-step processes. whatever we're using in 2028 will still be answering those.

which leaves me with a question i keep coming back to: if the model is the commoditized layer and the infrastructure is the differentiated layer, why is so much of the conversation still about benchmarks?

sources: openai, "function calling and other api updates" (jun 13, 2023) · openai, "introducing structured outputs in the api" (aug 6, 2024) · google developers blog, "gemini 1.5 pro and 1.5 flash ga, 1.5 flash tuning support, higher rate limits, and more api updates" (may 30, 2024; json schema mode) · google developers blog, "mastering controlled generation with gemini 1.5: schema adherence for developers" (sep 3, 2024) · claude blog, "structured outputs on the claude developer platform" (nov 14, 2025; public beta) · claude docs, "structured outputs" (supported schema features, invalid outputs) · anthropic, "introducing the model context protocol" (nov 25, 2024) · mcp blog, "one year of mcp: november 2025 spec release" (nov 25, 2025; registry "close to two thousand entries") · google developers blog, "gemini 1.5 pro 2m context window, code execution capabilities, and gemma 2 are available today" (jun 27, 2024) · google ai for developers, gemini api pricing, gemini 2.5 flash standard paid tier: $0.03 per 1m cached text tokens plus $1.00 per 1m tokens per hour storage (as listed jan 2026) · github repos langchain-ai/langchain (created oct 17, 2022) and run-llama/llama_index (created nov 2, 2022) · microsoft azure blog, "introducing microsoft agent framework" (oct 1, 2025) · ai sdk docs, "ai sdk rsc" overview and "generative user interfaces" (ai sdk ui) · anthropic engineering, "effective context engineering for ai agents" (sep 29, 2025) · anthropic engineering, "writing effective tools for agents, with agents" (sep 11, 2025)