Your agent asks a payments tool to send a refund. Thirty seconds pass, and you get no response. Should the agent try again? If the first request reached the payments system, a second request might send the money twice. If the first request never arrived, not retrying means the customer gets nothing. People building distributed systems wrote about this dilemma in 1984. No protocol since has made it go away. This chapter looks at forty years of calling code that lives somewhere else. You will see which problems are old, which are new, and which parts of today’s tools are likely to change next year.
Section 1.1
1984: make a remote call look local
Imagine a function call within a single program. You call refund(order); it runs and returns. If it fails, you know immediately. Now, move refund to a different machine. The function call must transform into a message, travel across a network, execute on the remote machine, and return as another message.
Bruce Jay Nelson is widely recognized for coining the term “remote procedure call” in 19811. He and Andrew Birrell at Xerox PARC developed “Lupine”, which “automatically generated stubs, providing type-safe bindings”1. A stub is a small, generated code segment. To the caller, it appears to be the local function. In reality, it packages arguments into a message and transmits it. Birrell and Nelson intended RPC to “remove unnecessary difficulties, leaving only the fundamental difficulties of building distributed systems: timing, independent failure of components, and the coexistence of independent execution environments”2.
Their 1984 paper openly discusses what the stub cannot conceal. If the call returns, the procedure executed exactly once. “Otherwise, an exception is reported to the user and the procedure will have been invoked either once or not at all—the user is not told which”2. Worse: “If an exception is reported, the user does not know whether the server has crashed or whether there is a problem in the communication network”2.
Sun’s RPC, documented as RFC 1057 in 1988, offered servers a partial defense. Each message includes a transaction ID, and a server “may choose to remember this ID after executing a call and not execute calls with the same ID in order to achieve some degree of execute-at-most-once semantics”3. Even over TCP, if the caller “receives no reply message, it cannot assume the remote procedure was not executed”3.
This means the caller bears the burden. For some procedures, this is simpler: “Idempotent procedures (those that have no additional effects if called more than once) are easily handled”1. Reading an account balance twice does not change it. Sending a refund twice does. This distinction—between calls you can safely repeat and those you cannot—will be important throughout our course and for an agent’s tool list.
Check yourselfSuppose a tool call times out. Which is safe to retry without further consideration: get_balance or send_refund?
Section 1.2
2000s: describe it for strangers
Birrell and Nelson’s callers were programmers working in the same lab. A new problem arose with strangers: how can a program from one company call a service from another? You need a shared way to describe the service and a way to find it.
CORBA 1.0, released in October 1991, included an “Interface Definition Language (IDL)” and an “Interface Repository”6. An IDL is a neutral language. You use it to write down what a remote object offers, including its operations and argument types. An interface repository lets a program ask, at run time, what interfaces are available. A standard “out of the box” interoperability architecture became available only with CORBA 2.0, in August 19966.
The web then shifted remote calls to HTTP. The XML-RPC specification of 1999 states it clearly: “An XML-RPC message is an HTTP-POST request”7. SOAP 1.1, a W3C Note from May 2000, added an envelope and “a convention for representing remote procedure calls and responses”8. WSDL 1.1, from 2001, described a service using XML “as a set of endpoints operating on messages”9.
The final component was discovery: a public directory where any company could publish its services and any other could find them. This was the UDDI Business Registry. Microsoft, IBM, and SAP shut it down. Publication was “disabled as of January 12, 2006”5. By Microsoft’s own count, it had managed “over 50,000 replicated entries” over five years5. An analyst at ZapThink explained why the vision failed: “there’s always a human element to establishing a relationship”5. The format for describing services survived. Automated trust between strangers did not.
Meanwhile, in 2000, Roy Fielding’s dissertation described REST. Its stateless constraint means “each request from client to server must contain all of the information necessary to understand the request” and “Session state is therefore kept entirely on the client”10. Hold on to that sentence; MCP arrives at the same place in 2026. REST’s constraints say how to talk to a service, not how to describe one; OpenAPI later gave HTTP APIs a standard description. Version 3.0.0, published in July 2017, “allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic”4. In 2015 Google open-sourced gRPC11 and Facebook began open-sourcing GraphQL, whose servers “can be queried for the types it supports”12.
Check yourselfThe public UDDI registry closed in 2006. Did describing services for strangers fail?
Section 1.3
2022–24: the caller becomes a model
Until recently, every caller was a program. A programmer would read the IDL or OpenAPI document, write code based on it, and that code would send the exact call it was designed to send. In 2022, the caller began to change.
ReAct, posted in October 2022, prompted language models to produce “reasoning traces and task-specific actions in an interleaved manner” and showed the approach “interacting with a simple Wikipedia API”14. The action was text in the model’s output, and the surrounding program had to find and run it. Toolformer, in February 2023, trained a model “to decide which APIs to call, when to call them, what arguments to pass, and how to best incorporate the results”15. At inference, decoding pauses when the model produces a special token, the program calls the API, and decoding continues with the response inserted15. Gorilla, in May 2023, named the new failure: a hallucinated call is “an API call that is not a sub-tree of any API in the database – invoking an entirely imagined tool”16. All three are research systems built on 2022–2023 models.
Frameworks and APIs then gave the call a structure. LangChain’s history shows that “In the early days, tool use was simplistic”: a model generated a tool name and one input string17. On May 2, 2023 LangChain introduced structured tools that “can take in an arbitrary number of inputs of arbitrary types”17. OpenAI’s ChatGPT plugins, launched March 23, 2023, asked developers to describe their API with an OpenAPI specification and a manifest18. Its red team had already “discovered ways for plugins—if released without safeguards—to perform sophisticated prompt injection, send fraudulent and spam emails, bypass safety restrictions, or misuse information sent to the plugin”18.
On June 13, 2023 OpenAI moved this structure into the API itself. Developers describe functions “via JSON Schema”, and the model can “choose to output a JSON object containing arguments to call those functions”13. The same post warned that “untrusted data from a tool’s output can instruct the model to perform unintended actions”13. Google’s Gemini API listed function calling among its launch features on December 13, 202319. In November 2023, OpenAI released the Assistants API with hosted tools such as Code Interpreter, and function calling gained “the ability to call multiple functions in a single message”20.
The caller has changed. A traditional program sends exactly what its author wrote. A model, however, reads a plain-language description and makes a guess. It might choose the wrong tool, invent a tool that does not exist, or follow an instruction hidden in text that a tool returned. The description is no longer just documentation a programmer consults once. It is the input the caller acts on every time.
Check yourselfOn launch day in June 2023, what risk did OpenAI already warn about?
Section 1.4
2024: one protocol for every tool
Before MCP, each agent application wrote its own connectors. Anthropic’s announcement on November 25, 2024 named the problem: “Every new data source requires its own custom implementation, making truly connected systems difficult to scale”22. Their solution was the Model Context Protocol (MCP), designed to replace “fragmented integrations with a single protocol”22.
The design has three roles. The first specification, dated 2024-11-05, defines hosts as “LLM applications that initiate connections”, clients as “Connectors within the host application”, and servers as “Services that provide context and capabilities”21. The current architecture page explains the mechanics clearly: “The MCP host accomplishes this by creating one MCP client for each MCP server”23. All messages “MUST follow the JSON-RPC 2.0 specification”24, a “stateless, light-weight remote procedure call (RPC) protocol” that is “transport agnostic”25. The first version specified two transports: “stdio, communication over standard in and standard out” and “HTTP with Server-Sent Events (SSE)”26.
The first specification also stated what MCP would not do. “While MCP itself cannot enforce these security principles at the protocol level, implementors SHOULD” build “robust consent and authorization flows into their applications”21. MCP standardizes how you describe and call a tool. The host still decides whether a call should run.
Within six months the large vendors adopted it: OpenAI’s Agents SDK on March 26, 202527, Google’s Agent Development Kit at its April 9, 2025 launch28, Microsoft at Build on May 19, 2025, where it also joined “the MCP Steering Committee”29, and OpenAI’s Responses API on May 20, 202530.
Check yourselfDoes connecting a tool through MCP make it safe to use?
No. MCP standardizes how a tool is described and called. Its first specification states that MCP “cannot enforce these security principles at the protocol level”; the host must21.
Section 1.5
Five versions in twenty months
MCP published five versions between November 2024 and July 2026: 2024-11-0526, 2025-03-2631, 2025-06-1833, 2025-11-2534 and 2026-07-2832. Lay them side by side and two kinds of parts appear.
Some parts kept moving. The transport changed in the second version, which “Replaced the previous HTTP+SSE transport with a more flexible Streamable HTTP transport”31. The same version added JSON-RPC batching31; the next version removed it33. Authorization went from absent (“Authentication and authorization are not currently part of the core MCP specification”24) to OAuth 2.131,35, then to servers acting as OAuth resource servers that accept only tokens meant for them33,36, then to a new client registration mechanism34,37, with the old one deprecated in 202632,38.
The 2026 version made the biggest break. It removed “the initialize/notifications/initialized handshake” and “protocol-level sessions”32. The maintainers explained their reasoning: “Any request can now land on any server instance behind a plain round-robin load balancer without needing shared storage”39. They stated that a server needing state across calls should “mint an explicit handle from a tool and have the model pass it back as an argument”39. Fielding argued for statelessness in 200010; MCP arrived at the same design in 2026. We observe this parallel; the maintainers do not claim it.
Other parts stayed. Tools were a server feature in the first version24. In the 2026 version servers still return them from tools/list32. Tool annotations, added in 202531, are still there, and clients “MUST consider” them untrusted “unless they come from trusted servers”40. The data layer of the current architecture still lists “core primitives, such as tools, resources, prompts and notifications”23. One year in, the maintainers called MCP “the de-facto standard” for providing context to models41.
Check yourselfIf you build an MCP server today, which parts would you expect to change again?
Section 1.6
2026: the provider runs the loop
In 2022 every application wrote its own loop: ask the model, run the tool it requested, paste the result back, ask again. OpenAI made a first attempt to host part of that loop with the Assistants API in November 2023, whose threads let developers “hand off thread state management to OpenAI”20. That API shut down on August 26, 202630.
By then both large providers offered the whole loop as a product. Anthropic launched Claude Managed Agents in public beta on April 8, 2026, as “a fully managed agent harness for running Claude as an autonomous agent with secure sandboxing, built-in tools, and server-sent event streaming”43. OpenAI released its Agents API in public beta on September 10, 2026, with “a managed Codex harness while OpenAI handles session orchestration, context compaction, and recovery”30. OpenAI’s documentation says the Agents API “manages the agent loop for you”44.
When someone else runs the loop, their defaults become your behavior. In Claude Managed Agents, “the agent toolset defaults to always_allow, and MCP toolsets default to always_ask“42, and custom tools sit outside these policies because your application runs them42. A later release added an auto policy in which “the server evaluates each agent or MCP tool call and runs it, denies it, or pauses for your approval”43.
Check yourselfYour agent moves onto a provider-run loop. What do you still control?
You control the decisions: which tools the agent may use, with whose credentials, and which calls require human approval. The provider’s defaults remain until you change them. For example, in Claude Managed Agents, the built-in toolset starts at always_allow42.
Section 1.7
MCP borrowed plumbing, not answers
Now you can read MCP as a sum of older parts. Its messages are JSON-RPC 2.024,25. Its first version opened every connection with “Connection initialization, capability negotiation, and session control”24, the pattern of the Language Server Protocol, where “The initialize request is sent as the first request from the client to the server”45. The specification itself says “MCP takes some inspiration from the Language Server Protocol”21. A tool definition carries a name, a description and an inputSchema in JSON Schema40,46, the format function calling already used13,47. Asking a server what it offers repeats an idea as old as CORBA’s interface repository6.
Let’s be precise about the benefits of LSP’s design. A language server can “be implemented once and have different tools take advantage of it”48. This means an implementation can be reused. Each running server still serves a single development tool: “The protocol currently assumes that one server serves one tool”45. MCP’s local servers work the same way, usually serving a single client23, but “remote MCP servers that use the Streamable HTTP transport will typically serve many MCP clients”23.
What MCP did not take was an answer to the questions from 1984. Did the call run? The 2026 transport says that when a stream breaks, the client “MUST re-issue it as a new request with a new request ID”32; if the first request had already taken effect, a re-issued call can run it again. That consequence is our inference, the same one Birrell and Nelson spelled out2. Where did the tool come from, and can you trust its description? Annotations stay untrusted unless the server is trusted40. Who may call it? The first specification left enforcement to implementors21.
Check yourselfWhich of the three open questions could a retry make worse?
“Did it run?” If the first call ran but the reply was lost, a retry runs it again. This could lead to two refunds or two emails. A failed call “will have been invoked either once or not at all”2.
Section 1.8
The judgment call: what lasts?
A new protocol arrives every few years, and each one is sold as the answer. How do you decide what to learn deeply and what to treat as this year’s packaging? Yan Wang gave our class a ruler in his October 2 guest lecture: “Every hot noun bundles a lasting problem with packaging from its year”49. The lasting problem is “The underlying need that remains whatever the model does; understanding it appreciates.” The packaging is “The brand-name implementation shaped around the limits of its year; it depreciates”49.
He splits them with two questions: “If the model were 10x better, would this still matter?” and “What problem is it actually solving, and do I still have it?”49 For MCP, his split puts “Giving agents clear, safe interfaces and deciding what plain code should handle” on the lasting side, and “Routing every tool definition and result through the context window, MCP-first” on the packaging side49.
Let’s apply this test to what we covered in this chapter. “Did it run?” passes both questions: a smarter caller still cannot see a lost reply. Describing a service and deciding who can call it also pass; these have been re-solved since 1991. Protocol sessions fail the second question: the need they served, keeping state across calls, can be met with a handle the model passes back, and MCP removed them in 202632,39. That shows the pattern of a packaging decision.
This guideline has a limit. “Packaging” means you should not base your entire judgment on it. It does not mean you can ignore it: a change in transport can break every server you operate. Also, the distinction is a judgment, not a measurement. Two careful engineers might categorize the same feature differently and should be able to explain their reasoning.
Check yourselfMCP’s 2026 version removed protocol-level sessions. Is this a lasting problem, or packaging?
Before you go on
Close the book
- Tell the story of remote calls in five sentences, one per era: 1984, the 2000s, 2022–23, 2024 and 2026. Then name the three questions that are still open.
- Choose one feature from a tool protocol you use. This could be a transport, a registry, or a permission prompt. Apply Yan Wang’s two questions to it and determine if it represents a lasting problem or merely packaging.
- Imagine your agent’s
send_emailtool timed out. Explain to a teammate why simply retrying isn’t automatically safe. Then, describe what the tool would need to make a retry safe.
Chapter one · quiz
Test yourself
Most questions have more than one right answer, so select every option that is true. Check each question, then open “Answer and why” for the reasoning.
Sources
- Remote procedure call. Wikipedia. en.wikipedia.org/wiki/Remote_procedure_call ↗
- Implementing Remote Procedure Calls (Birrell & Nelson), ACM TOCS 2(1). ACM Transactions on Computer Systems (copy hosted at cmu.edu). www.cs.cmu.edu/~dga/15-712/F07/papers/birrell842.pdf ↗
- RFC 1057: RPC: Remote Procedure Call Protocol Specification Version 2. Sun Microsystems / RFC Editor. www.rfc-editor.org/rfc/rfc1057.txt ↗
- OpenAPI Specification v3.0.0. OpenAPI Initiative / Linux Foundation. spec.openapis.org/oas/v3.0.0.html ↗
- Microsoft, IBM, SAP discontinue UDDI registry effort. InfoWorld (Paul Krill). www.infoworld.com/article/2215182/microsoft-ibm-sap-discontinue-uddi-registry-effort.html ↗
- History of CORBA. Object Management Group. www.omg.org/gettingstarted/history_of_corba.htm ↗
- XML-RPC Specification. Dave Winer / UserLand Software (xmlrpc.com). xmlrpc.com/spec.md ↗
- Simple Object Access Protocol (SOAP) 1.1, W3C Note. W3C (member submission: DevelopMentor, IBM, Lotus, Microsoft, UserLand). www.w3.org/TR/2000/NOTE-SOAP-20000508 ↗
- Web Services Description Language (WSDL) 1.1, W3C Note. W3C (member submission: Ariba, IBM, Microsoft). www.w3.org/TR/2001/NOTE-wsdl-20010315 ↗
- Fielding Dissertation, Chapter 5: Representational State Transfer (REST). Roy T. Fielding, UC Irvine. ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm ↗
- Introducing gRPC, a new open source HTTP/2 RPC Framework. Google Developers Blog (Mugur Marculescu). developers.googleblog.com/2015/02/introducing-grpc-new-open-source-http2.html ↗
- GraphQL: A data query language. Facebook Engineering (Lee Byron). engineering.fb.com/2015/09/14/core-infra/graphql-a-data-query-language ↗
- Function calling and other API updates. OpenAI. openai.com/index/function-calling-and-other-api-updates ↗
- Yao et al. "ReAct: Synergizing Reasoning and Acting in Language Models." ICLR (2023).. arXiv (Yao et al.). arxiv.org/abs/2210.03629 ↗
- Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv (Schick et al.). arxiv.org/abs/2302.04761 ↗
- Gorilla: Large Language Model Connected with Massive APIs. arXiv (Patil et al., UC Berkeley). arxiv.org/abs/2305.15334 ↗
- Structured Tools. LangChain. www.langchain.com/blog/structured-tools ↗
- ChatGPT plugins. OpenAI. openai.com/index/chatgpt-plugins ↗
- It’s time for developers and enterprises to build with Gemini Pro. Google (The Keyword). blog.google/innovation-and-ai/products/gemini-api-developers-cloud ↗
- New models and developer products announced at DevDay. OpenAI. openai.com/index/new-models-and-developer-products-announced-at-devday ↗
- Specification (revision 2024-11-05), Overview. Model Context Protocol. modelcontextprotocol.io/specification/2024-11-05 ↗
- Introducing the Model Context Protocol. Anthropic. www.anthropic.com/news/model-context-protocol ↗
- Architecture overview, MCP docs (round-1 source, B7/B14 URL; page version 2026-07-28). modelcontextprotocol.io (assigned reading; now serves the 2026-07-28 docs). modelcontextprotocol.io/docs/learn/architecture ↗
- Specification (revision 2024-11-05), Base Protocol overview. Model Context Protocol. modelcontextprotocol.io/specification/2024-11-05/basic ↗
- JSON-RPC 2.0 Specification. JSON-RPC Working Group. www.jsonrpc.org/specification ↗
- Specification (revision 2024-11-05), Transports. Model Context Protocol. modelcontextprotocol.io/specification/2024-11-05/basic/transports ↗
- Release v0.0.7 · openai/openai-agents-python. OpenAI (GitHub release). github.com/openai/openai-agents-python/releases/tag/v0.0.7 ↗
- Agent Development Kit: Making it easy to build multi-agent applications. Google for Developers Blog. developers.googleblog.com/en/agent-development-kit-easy-to-build-multi-agent-applications ↗
- Microsoft Build 2025: The age of AI agents and building the open agentic web. Microsoft (Official Microsoft Blog). blogs.microsoft.com/blog/2025/05/19/microsoft-build-2025-the-age-of-ai-agents-and-building-the-open-agentic-web ↗
- Changelog | OpenAI API (round-1 source, A28 URL). OpenAI. developers.openai.com/api/docs/changelog ↗
- Key Changes (2025-03-26). modelcontextprotocol.io. modelcontextprotocol.io/specification/2025-03-26/changelog ↗
- MCP specification 2026-07-28: Key Changes. Model Context Protocol. modelcontextprotocol.io/specification/2026-07-28/changelog ↗
- Key Changes (2025-06-18). modelcontextprotocol.io. modelcontextprotocol.io/specification/2025-06-18/changelog ↗
- MCP specification 2025-11-25: Key Changes. Model Context Protocol. modelcontextprotocol.io/specification/2025-11-25/changelog ↗
- Authorization (MCP specification, version 2025-03-26). Model Context Protocol (LF Projects, LLC). modelcontextprotocol.io/specification/2025-03-26/basic/authorization ↗
- Authorization (MCP specification, version 2025-06-18). Model Context Protocol (LF Projects, LLC). modelcontextprotocol.io/specification/2025-06-18/basic/authorization ↗
- Authorization (MCP specification, version 2025-11-25). Model Context Protocol (LF Projects, LLC). modelcontextprotocol.io/specification/2025-11-25/basic/authorization ↗
- Authorization - Overview (MCP specification, version 2026-07-28). Model Context Protocol (LF Projects, LLC). modelcontextprotocol.io/specification/2026-07-28/basic/authorization ↗
- MCP 2026-07-28 Specification Release. MCP Blog (D. Soria Parra, D. Delimarsky, Lead Maintainers). blog.modelcontextprotocol.io/posts/2026-07-28 ↗
- Tools - Model Context Protocol (spec version 2026-07-28, latest). Model Context Protocol (LF Projects). modelcontextprotocol.io/specification/latest/server/tools ↗
- One Year of MCP: November 2025 Spec Release. MCP Core Maintainers. blog.modelcontextprotocol.io/posts/2025-11-25-first-mcp-anniversary ↗
- Permission policies (Claude Managed Agents). Anthropic (Claude Platform Docs). platform.claude.com/docs/en/managed-agents/permission-policies ↗
- Claude Platform release notes (round-1 source, A29 URL). Anthropic. platform.claude.com/docs/en/release-notes/overview ↗
- Programmatic Tool Calling. OpenAI. developers.openai.com/api/docs/guides/tools-programmatic-tool-calling ↗
- Language Server Protocol Specification - 3.17. Microsoft (LSP site). microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification ↗
- MCP TypeScript SDK v2 Overview. ts.sdk.modelcontextprotocol.io/v2 ↗
- Define tools. Anthropic. platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use ↗
- A Common Protocol for Languages. Microsoft, Visual Studio Code team blog. code.visualstudio.com/blogs/2016/06/27/common-language-protocol ↗
- What Gets You Hired, What Gets You Promoted, and What AI Changed. Yan Wang guest deck. ai-builders.com/resources/w4995 ↗