# API-first experiment — first-person notes

20 slides: introduction, 18 walkthrough slides and Q&A. Three six-slide acts; this experiment does not claim a 15-minute runtime. All transactions are fictional.

## Slide 1. Faizan Khan

I’m Faizan. At Docsalot we create and host MCP servers, including read-only access to more than 300 documentation sites. For this experiment I want to put the protocol name aside and build the need for it. We’ll start with ordinary HTTP APIs, make one assistant useful, and then ask what happens when another AI application wants the same capabilities. This is an architecture walkthrough with fictional products and transactions, not a live checkout or a claim that we have implemented every diagram. Our question is simple: which parts belong to the store, which belong to the AI application, and which parts would benefit from a shared agreement?

## Slide 2. Maya wants her AI to do the shopping.

Maya asks her AI: find me a blue carry-on backpack under a hundred dollars, delivered by Friday. She is not opening our storefront and clicking through product pages. Her assistant needs to discover a real item, get a delivery quote, explain the total and ask before committing the purchase. Our store still owns its inventory and orders. The address and delivery providers know other parts of the answer. Let’s assume MCP does not exist and start with the simplest useful thing: expose the services as ordinary APIs. We will keep Maya’s identity, the quoted price and the eventual order consistent as the design grows.

## Slide 3. Each service knows one part of Maya’s request.

Our first challenge is explaining functionality. The catalog finds backpacks, GeoRoute resolves the saved destination, ParcelQuote estimates shipping and arrival, and our order service places or cancels purchases. Maya’s AI needs to understand those jobs before it can choose the right operation. An endpoint address alone does not communicate when to use it, which inputs it needs or what its answer means. We still expose ordinary HTTP APIs, and OpenAPI descriptions can already capture much of this information. But we must deliberately write clear descriptions and make them available through the host’s integration. The service names, purpose, inputs and useful results form the capability menu the model reasons over. The store is headless in this example: the assistant is choosing functions instead of clicking through a storefront.

## Slide 4. With a fixed application, we can write the flow ourselves.

If I were building a conventional application, I would write this sequence myself. Search the catalog, resolve the destination, ask the delivery provider for a quote and prepare an order draft. Our fictional item costs seventy-nine dollars, the route is twelve kilometres and shipping is twelve dollars with an estimated Friday arrival. The fixture total is ninety-one dollars, including tax and shipping. Nothing here requires MCP. Shared libraries, good API documentation and an OpenAPI description can already reduce the work. What changes in our story is that Maya is speaking freely to an AI, rather than following a fixed interface that I designed in advance. Now somebody has to connect that conversation to the right operations.

## Slide 5. Turn Maya’s request into a real API call.

Maya asks what delivery will cost. On the left is a normalized function-call fragment: the model proposes quote delivery with a real product identifier and her saved demo-home destination. That describes an operation; it does not execute the API. On the right is Python taken from our combined local store example. Our adapter sends an HTTP request to the GeoRoute fixture, checks the response and reads the route result. It then passes that distance to ParcelQuote and returns a complete delivery quote. We show only the first provider call here so the code stays readable. The HTTP client is created in the surrounding function. A real ChatGPT action uses its configured OpenAPI schema and authentication; this small JSON fragment illustrates the requested function and arguments rather than the host-specific wire format. This is the integration boundary we need to build: connect the model’s choice to validated code that can actually call the service. The execution code is only half the integration. Before this call can be proposed, the host must give the model a useful description of quote_delivery, including when to choose it instead of product search or order placement. That capability description is the main problem we are about to solve.

## Slide 6. Teach the AI what each function is for.

This is the key integration problem: conveying the store’s functionality to the model so it can choose an appropriate call. A function needs more than a clever name. I describe its job, the inputs it accepts and the result it gives back. The model should use product search to find an item, quote delivery to estimate a total and arrival, and place order only after the confirmed checkout. The JSON here is a normalized explanatory function card, not a complete OpenAPI or MCP schema. For our API-only ChatGPT route, we put the operation descriptions, parameter schemas and responses into the Custom GPT action’s OpenAPI definition and configure authentication. In a custom host, we provide the model’s supported function-definition format. Both approaches work without MCP. We still need to test ambiguous questions, missing inputs and cases where the model should ask a question rather than call a function.

## Slide 7. The model proposes. Our adapter does the work.

Now we have a real call path. The model proposes search products with a query and color. The ChatGPT host sends the described action request. Our store adapter validates the inputs, calls the catalog API and returns a result. The model can use that result to answer Maya or request the next operation. This is what developers mean by a tool: a named, callable function with a purpose and defined inputs. It can read information, so a search counts as a tool. It can also change state, as placing an order does. The model is not running our backend code and is not holding our provider credentials. In a custom API host, our own application would implement the surrounding model-call loop.

## Slide 8. Maya’s identity cannot be a prompt parameter.

Before quoting a saved address or reading an order, I need to know whose data this is. Maya signs in and grants the intended access. The adapter derives her customer identity from verified credentials rather than trusting a customer identifier generated by the model. It checks whether the token permits the operation. Our server keeps its GeoRoute and ParcelQuote credentials on the trusted side and sends only the data those providers need. This is not a new problem invented by AI, and MCP will not make it disappear. But an assistant taking action on someone’s behalf makes the trust boundary especially important. A tool definition is a description of a capability; it is never proof that Maya authorized the action.

## Slide 9. A quote is information. A purchase is a commitment.

We found a product and shipping estimate. That does not authorize a purchase. I present the ninety-one-dollar quote with the item, destination and validity period. Maya explicitly confirms that specific checkout. The adapter verifies that the quote still exists, has not expired, belongs to Maya and matches what she confirmed. Only then does it request order creation. In this example, confirmation is a trusted host interaction linked to the quote; a model-generated confirmed equals true flag would not prove consent. We are illustrating order creation, not processing real payments. The exact checkout and consent experience depends on the host and its policies. The important design step is to separate reading a quote from committing an order.

## Slide 10. Then Maya says: “Actually, cancel it.”

Maya’s follow-up gives us two more requirements. The host needs to resolve it to the right order using the conversation and verified customer context. The server then checks ownership and the current fulfilment state. Our fictional policy permits cancellation before dispatch. Once dispatched, it returns a clear refusal or next option rather than pretending cancellation succeeded. We also need retry-safe operations. If a network response is lost, repeating purchase creation with the same operation key should not buy a second backpack. A protocol request identifier alone is not a business idempotency guarantee. Cancellation status and payment reversal status must remain separate. These rules belong in the store backend regardless of how an AI calls it.

## Slide 11. Tomorrow Maya asks: “Where is my parcel now?”

Now we extend the product. Maya has bought the backpack and asks where the parcel is. We add a carrier-tracking capability called track shipment, which is a proposed extension for this teaching example, not one of the five tools already installed in our local demo. Implementing the carrier API is only half the job. We also describe when this capability should be used, what order identifier it accepts and what tracking facts it returns. In the API-only integration, we update the host’s action or function definitions and execution mapping. If several hosts have their own copies, those copies can drift. We must refresh the available definitions and test that the model chooses tracking rather than product search or order creation. The server still enforces ownership. With MCP later, the host can obtain an updated tool catalog from the server; refresh and caching behavior still depend on the host.

## Slide 12. What if Maya changes her model—or her AI app?

There are two different changes here. If I swap the model inside the same AI host, that host may keep the same function definitions and execution code. I should not claim that every new model requires rewriting our APIs or the whole integration. I do need to check supported schemas and evaluate tool selection, argument generation and whether it respects the confirmation flow. If Maya moves to a different provider or AI application, the function-definition format, execution integration and permission experience may also differ. The store’s underlying capabilities have not changed. We want a reusable server-side contract that compatible hosts can adapt to their own models. MCP helps at that client-server boundary; it does not force all models to choose the same tool or eliminate host-specific work. That distinction is why I separate changing a model from changing the AI host.

## Slide 13. These are the three things we want to make reusable.

Here are the three problems our protocol should address. First, communicate what the services can do so the model has a useful menu. Second, make new capabilities available without manually maintaining a disconnected copy for every integration. Third, expose a reusable server interface that different AI hosts can connect to. Names, descriptions and schemas address the first requirement. A discoverable, updated capability catalog addresses the second. A shared client-server contract addresses the third. OpenAPI, shared gateways and libraries can already solve parts of this, so MCP is not the only possible answer. Its value is an existing common contract that compatible hosts implement. The host still maps these definitions into its model’s supported format, manages context and evaluates the resulting choices. The store keeps its authorization and business logic.

## Slide 14. Let the server describe its current capabilities.

The first agreement is discovery. A connected MCP client can ask the server for its available tools using tools slash list. Each tool provides a name, description and input schema, so the application has a defined way to obtain the menu. The host chooses which tools to make available to the model and may transform their definitions into the model provider’s format. The server must still filter or authorize capabilities appropriately, and a listed tool does not grant permission to use it. Discovery is a protocol operation, not the model guessing API URLs and not a marketplace search. Connection and capability details depend on the protocol version and host. We are focusing on the common discovery and execution concepts rather than implementing a wire protocol by hand. This also connects to the extension problem: once a new capability is implemented and described on the server, a host that refreshes its catalog can discover it. The host may cache definitions, filter tools or require a reconnect; discovery is not a promise of instant automatic availability in every model conversation. The descriptions and schemas still need careful design and testing.

## Slide 15. Call a function through the shared interface.

The next agreement is invocation. The host’s MCP client sends a tools slash call request with the tool name and arguments. This is an illustrative fragment, not a complete JSON-RPC message or SDK example. Our server receives quote delivery, validates the request and calls the same catalog, routing and delivery APIs we already had. It then returns an MCP result containing the relevant quote information. A common envelope makes transport and parsing more reusable, but the store defines the actual quote fields and business errors. Request IDs associate protocol messages; our checkout idempotency key solves a different business problem. Notice that the model still proposes operations through its host. It is not directly opening a network connection to the MCP server.

## Slide 16. That reusable boundary is the MCP server.

Now the label has a reason to exist. The store MCP server publishes a shared AI-facing interface over the capabilities we already built. A host is the AI application Maya uses. Its MCP client communicates with our server. Our server executes the store operation through existing adapters and APIs. ChatGPT and the other applications still have their own product behavior, permissions and supported features. The diagram assumes each host has an appropriate MCP connection configured; deployment and listing are separate tasks. In this example the store aggregates its four services behind one server. Another design could expose multiple servers. There is no universal MCP hub in the middle and no requirement that the model itself understand or speak the wire protocol. If we add shipment tracking, the store adds its implementation and description to this server. If Maya uses another compatible host, it can discover the same server capabilities. The host remains responsible for adapting tool definitions to its chosen model and testing its behavior.

## Slide 17. The same agreement can carry context and starting points.

Our derivation began with callable functions because Maya wanted something done. MCP also lets a server expose resources and prompts. A resource is readable context, such as the return policy or size guide, which the application can load for the model. A prompt is a reusable message template the user can choose, such as help me choose a backpack. Tools perform requested functions, including read-only searches and state-changing actions. These are complementary capabilities; this picture is not a mandatory pipeline. A server can expose just tools, and host support for resources and prompts differs. We should verify the target host before relying on them. The host controls how context reaches its model and how the user experiences these capabilities.

## Slide 18. A lot of JSON. Only a few useful facts.

This is another practical reason to build an adapter around our service functionality. A provider may return a large JSON payload with the facts we need mixed among route metadata, service flags, cache information and diagnostics. On the left is an illustrative full response; it can be scrolled. I highlight the quote identifier, amounts, currency, arrival estimate and validity. Our MCP server’s code selects those facts, adds the item and shipping amounts, and returns the smaller result on the right. The total remains ninety-one dollars, or nine thousand one hundred cents. It keeps the quote ID so the next purchase request can refer to the actual quote, the currency so the amount is unambiguous, the expiry, and the fact that Friday is only an estimate. This does not happen automatically because a response passes through MCP. We implement the transformation; MCP carries the tool result in a standard form. We should preserve meaningful errors and any details required for Maya’s decision or the next action. The backend can retain diagnostics for investigation without sending every internal field into the model’s context.

## Slide 19. We did not replace the APIs. We extracted a shared interface.

We began with a store whose APIs already performed useful business operations. The difficult AI-facing work was explaining what each operation does so the model can choose, making an added capability available, and carrying that interface into another AI application. MCP gives us standard ways to describe and discover tools and invoke them through a shared client-server contract. It does not write the descriptions for us or guarantee that a model chooses correctly. We still test selection, inputs and failures when the functionality or model changes. A model swap inside a host may reuse the same integration; a new host may need different model-facing mapping. The store still owns consent, authorization, idempotency and operations. A direct API integration can be enough for one application. The benefit of the shared interface becomes clearer as the set of capabilities and compatible hosts grows.

## Slide 20. MCP gives AI apps one way to use our store.

We started with Maya asking her AI to buy a backpack. Our APIs could already search, quote delivery, create an order and cancel it. The first problem was telling the model what those functions do so it could choose the right one. The second was adding a capability, such as carrier tracking, and ensuring the host obtains its updated definition. The third was letting another AI application use that functionality without rebuilding the store integration from scratch. MCP provides a shared way for compatible hosts to discover and request these capabilities. The host still maps the definitions to its chosen model, and we still test the model’s choices. Our store APIs execute the business operations and enforce identity, purchase consent and cancellation rules. That is the concrete role of MCP in this example. What questions do you have?