Part 1 10 chapters

Build: synchronous APIs

Build the request/response surface: REST and GraphQL endpoints shaped so an agent can call them as MCP tools.

Chapter 3

Intent Endpoint (over CRUD)

One intent-named endpoint performs a whole business operation atomically, where a chatty sequence of CRUD calls leaves a window of partial state an agent can observe and act on incorrectly.

25 minutesRead โ†’
Chapter 4

Search over Pagination

A typed-filter search call returns exactly the matching orders directly, measured against a raw pagination sweep that must scan page after page to find the same records.

20 minutesRead โ†’
Chapter 5

Batch Operation and Count Flag

An id-keyed batch endpoint resolves many identifiers in one call with explicit misses, and a count endpoint answers how many with a bare number, each measured against the one-at-a-time and fetch-everything alternatives they replace.

20 minutesRead โ†’
Chapter 6

Idempotency and Safe Retries

A required Idempotency-Key header, enforced by a server-side Idempotent Consumer, replays the first response byte for byte on a repeat key and rejects the same key reused with a different body, where an unguarded retry places a second order.

25 minutesRead โ†’
Chapter 7

Strict Self-Describing Contract (OpenAPI 3.1)

A precise OpenAPI 3.1 document, generated from the code and kept in sync with it, is the contract an agent actually reads before calling a tool.

25 minutesRead โ†’
Chapter 8

Semantic Metadata and llms.txt + Dual-Use Portal

A machine-readable llms.txt and a shared portal serve a browsing human and a reading agent from the same source, instead of two surfaces drifting apart.

20 minutesRead โ†’
Chapter 9

Token-Efficient Response / Agent BFF

A backend-for-frontend layer shapes a response for the token budget an agent actually has, instead of returning a human-facing payload unchanged.

25 minutesRead โ†’
Chapter 10

Instructive Error (RFC 9457)

An RFC 9457 problem response names what was wrong and what to try next, instead of a bare status code an agent cannot act on.

20 minutesRead โ†’
Chapter 11

Propose/Preview/Commit

A preview step lets an agent see the effect of a write before committing it, so an irreversible action is never the first thing that happens.

25 minutesRead โ†’
Chapter 12

MCP-First Single CDI Bean

One CDI bean serves REST, GraphQL and an MCP tool from the same business logic, so the three surfaces never drift apart.

25 minutesRead โ†’