CHAPTER 1
Fundamentals of the agentic web
From the mental model to the first tool registered within a page.
Move beyond diagnosis and turn a website into a structured, visible, and controllable tool surface.
Builder Chapters
Available modules
Published topics
Laboratories
SHARED PROGRESS
The same identifier as Formation 1 records completed items, questions, and notes. On GitHub Pages, the origin is shared; JSON keeps the fallback portable.
The top navigation moves between chapters. Within each chapter, modules follow the chapter.module numbering.
CHAPTER 1
From the mental model to the first tool registered within a page.
CHAPTER 2
Turn human journeys into clear, small, verifiable contracts.
CHAPTER 3
Connect tools to the interface, state, and backend without duplicating rules.
CHAPTER 4
Test selection, execution, safety, and experience before delivery.
Search, filter, and build a study list with operations shared between the interface and tools. See calls, results, and measurement limits.
Open the chained actions labCROSS-CUTTING LAB
Paste an auditable catalog in JSON and get a diagnosis of its contract, clarity, schema, lifecycle, risk, and sample output. The lab does not register or execute tools.
Build a mental model that distinguishes visual automation, APIs, MCP, and tools exposed directly by the page.
The same search can be performed by a person, visual automation, or a structured tool.
Comparing the three approaches builds the mental model that supports the rest of the course.
human goal · visual steps · explicit capability · same interface
Semantic web, browser automation, API, MCP, and agentic web solve different problems.
The distinction prevents similar names from becoming one vague abstraction.
understand · operate · call · discover
The page registers; the browser observes; the agent chooses; JavaScript executes; the result comes back.
Understanding the full lifecycle reveals where each responsibility really lives.
registration · discovery · selection · execution
A tool combines a name, description, schema, and an execute function.
Each field influences a different decision by the agent and the application.
name identifies · description guides · schema constrains · execute performs
Useful capabilities change across the home page, product, cart, and authenticated area.
A contextual catalog reduces noise and avoids offering impossible actions.
home searches · product selects · cart updates · session authorizes
The Builder must account for fallback, authorization, cancellation, evidence, and limits.
The project completes the mental model with a deliverable that can be demonstrated and critiqued.
fallback · safety · evidence · project
Prepare an environment that is safe, observable, and compatible with the experimental nature of the specification.
The ModelContext interface is defined for SecureContext; HTTPS and localhost are the lab’s minimum requirements.
The correct test distinguishes an unavailable API, experimental configuration, and an actual code failure.
HTTPS in production · localhost in the lab · flag may vary · origin matters
Vite provides a local server and ES modules; Node runs the project automation, not the document’s WebMCP API.
This separation lets you develop the site in any browser and enable WebMCP only as a progressive enhancement.
Node for tooling · Vite serves the page · API lives in the Document · build does not determine support
Feature detection checks for the actual capability at the time of use, without relying on the user agent or a fixed version.
As the draft changes, detecting the available surface is more durable than hard-coding a list of browsers.
test the property · fallback is functional · message is honest · no sniffing
DevTools, the console, and a local inspector help you observe registration, catalog changes, input, and results.
Without evidence, it's easy to confuse a well-registered tool with one that's actually safe and usable.
structured console · observable toolchange · test inputs · captured result
Types help the editor, and a polyfill can simulate the surface for testing, but neither proves the agent has native browser support.
Distinguishing simulation from implementation prevents false positives in the readiness report.
types don't execute · polyfill simulates · native is different · record the mode
The matrix records the browser, channel, flag, secure context, date, and test result.
An experimental API requires traceability; “it works here” isn’t enough for a team or for production.
test date · version and channel · documented flag · verified fallback
Turn semantic forms into tools agents can understand, while keeping them under user control.
The toolname and tooldescription attributes declare the form's intent without removing its HTML semantics.
It's the lowest-effort path for journeys that already have fields, validation, and a submit button.
form remains HTML · toolname identifies · description guides · progressive enhancement
The control's name becomes the property; toolparamdescription explains the meaning and expected format to the agent.
Labels help people, while precise descriptions reduce plausible but incorrect entries.
name is the key · label is for people · description guides selection · examples clarify
Input types, required, min, max, and options contribute to the schema synthesized by the browser.
Reusing semantic constraints keeps the manual form and the tool aligned.
required becomes a requirement · select limits values · min/max constrain · algorithm is still evolving
Without toolautosubmit, the agent fills in the form and the page returns focus to the user for review; with the attribute, submission can happen automatically.
The choice should follow the action’s risk and impact, not just the convenience of the workflow.
missing prompts review · boolean enables submission · risk guides decisions · UI shows completion
For agent-triggered submissions, agentInvoked lets you identify the source, and respondWith returns a Promise with the structured result.
The agent receives a verifiable protocol without relying on scraping the page after submission.
preventDefault first · test agentInvoked · Promise as response · error is structured
The draft describes tool activation and cancellation; support and event targets need to be confirmed in the browser being used.
The interface must remain readable when the agent starts, the user reviews, or the call is canceled.
explicit visual state · cancellation clears UI · draft may change · fallback doesn’t depend on this
Register JavaScript tools with schemas, asynchronous execution, cancellation, and structured results.
document.modelContext.registerTool accepts name, optional title, description, inputSchema, execute, and optional annotations. The name accepts 1 to 128 ASCII alphanumeric characters, underscores, hyphens, or periods.
The imperative approach supports workflows that don’t fit in a form or depend on rich logic and state.
unique name · nonempty description · execute required · registration returns a Promise
inputSchema uses JSON Schema to declare properties, types, enums, descriptions, and required fields.
The schema is part of the reasoning for choosing and generating arguments; actual validation must still happen in the code.
type object · focused properties · coherent required · validate in execute
The execute callback can return a Promise; the resolved value is delivered to the agent.
Small results, typed by convention and accompanied by evidence, make verification and chaining easier.
Promise is accepted · result is serializable · UI is updated · errors are useful
The registerTool signal removes the tool when aborted; the signal received by execute cancels the call in progress.
This model prevents obsolete tools and work from continuing after the agent loses interest.
registration signal removes · execution signal cancels · fetch accepts signal · cleanup is deterministic
getTools lists tools exposed to the document, and executeTool runs a RegisteredTool with structured input.
These operations enable in-page agents and controlled tests without simulating an external agent.
getTools is asynchronous · origin can filter · execute uses RegisteredTool · cancellation is optional
Searching, querying, and checking availability form a sequence with distinct responsibilities and no generic tool.
A streamlined catalog improves agent selection and creates a clear foundation for the Integrator phase.
search lists · query provides details · availability checks · no overlap
BUILDER CONTINUATION
After the fundamentals, the same training continues in chapters 2, 3, and 4. Each chapter will have its own modules; none of them changes the student’s role to Integrator, Agent, or Expert.