Run with Browser AI · Chapter 18

Run Chapter 18: WebMCP search_book Laboratory

Register, replace, remove and invoke a bounded search_book capability through live WebMCP when available, with an explicitly separate simulator for every other browser.

← Read Expose the First WebMCP Tool
Execution Not inspected
Secure contextUnknown
Top-level pageUnknown
Prompt APIUnknown
AvailabilityNot inspected

Chapter experiment

Expose the First WebMCP Tool

Metrics-only trace

Loading the chapter experiment…

No model output yet.
Inspect the context supplied by this chapter

What this experience knows

This experience is grounded in Chapter 18 and exposes one deliberately narrow read-only capability.

API boundary

The live path requires document.modelContext.registerTool, available behind the WebMCP origin trial from Chrome 149. Removal is driven by an AbortController signal passed to registerTool; controller.abort() withdraws the registration and, as of Chrome 153, does not interrupt an in-flight execution. Exact failures are retained rather than rewritten as generic unavailability.

Simulation boundary

The simulator and live WebMCP paths are separate actions. Simulator events carry surface: in-page-simulator; they are never counted as browser registrations.

Contract boundary

search_book accepts a 2–300 character query and an optional integer limit from 1–10. Additional properties are forbidden. The implementation validates these rules again.

Corpus boundary

Search is limited to a fixed eighteen-chapter summary index embedded in this experiment. It cannot read arbitrary DOM text, files, browser history or another origin.

Disclosure boundary

At most ten known references are returned. Excerpts are capped at 180 characters. Query text and excerpts remain in page memory under metrics-only capture.

Identity boundary

The Observatory records origin, tool name, contract version, registration ID, schema hash, definition hash and registration surface. Application-provided metadata remains browserAttested: false.

Lifecycle boundary

Inspection, registration, proposal, argument validation, policy admission, execution, result validation, replacement and removal are separate events. A resolved callback is not automatically a valid result.

Effect boundary

The tool declares a current-book read with no state mutation, no network and no external effect. Its safety annotations should mark it read-only, not consequential, and not a source of untrusted external content. The implementation performs no fetch, navigation, DOM actuation or persistence.

Behavioral boundary

Manual fixtures test the deterministic tool before a model chooses it. This chapter does not claim an agent discovered or selected the registration; that behavioral evaluation begins in Chapter 19.

This laboratory exposes the Chapter 17 search_book contract through the browser’s imperative WebMCP surface when the current context supports it. Registration, replacement, removal and callback invocation receive distinct trace events and correlation IDs.

The deterministic simulator is a separate button and a separate evidence source. It can test the contract on any browser, but it never claims that Chrome registered or exposed the tool.