From c0e703cab200236ac7b16b3407ea6e5b9bea9d0f Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 28 Sep 2026 15:52:06 -0700 Subject: [PATCH 1/3] Add explainer for continuations --- continuations-explainer.md | 265 +++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 continuations-explainer.md diff --git a/continuations-explainer.md b/continuations-explainer.md new file mode 100644 index 0000000..283e551 --- /dev/null +++ b/continuations-explainer.md @@ -0,0 +1,265 @@ +# Continuation Tokens + +[*mark a. foltz*](mailto:mfoltz@google.com) + +# Overview + +[WebMCP](https://webmachinelearning.github.io/webmcp/) allows sites to declare +imperative script tools to be invoked by agents. To complete a task, control +flow is typically exchanged between the site and the agent. The agent initiates +a tool call on the site, the site executes the tool with site-defined +Javascript, and returns output to the agent, which consumes the output and plans +the next action. + +However, tool calls are restricted to execute in a single document, and a single +Promise per tool call. This leads to unfortunate limitations: + +* If a site executes a server request that navigates the document, the original + tool request is ended and the agent does not receive a success signal or tool + output. +* If a tool call wants to append further output, for example to list a following + page of results, it has no way of doing so. + +We propose a *Tool Continuation* as a way for the tool author to request that +the agent invoke the tool at a future time on a related document. + +**This introduces a higher level of abstraction for the agent.** Instead of +acting on the site with a fragmented collection of tools partitioned according +to the site structure (pages/frames), it can act on the site as a cohesive +application with tools matching end-user use cases (like "checkout"). Tool +continuations allow these use cases to be implemented across documents and +frames without the agent needing to reverse engineer the site's internal +structure. + +# Use Cases (In Scope) + +Let's consider a clothing e-commerce site [dresswear.com](http://dresswear.com) +that allows the user to browse items of clothing, add them to a cart and check +out. + +## Cross-document tool invocation + +After completing add-to-cart, the user wants to check out. The site offers a +tool to do so: + +```js +checkout(shipping_address, billing_address, card_details) +``` + +However, the implementation of this tool is actually spread across three +distinct pages (`/shipping`, `/billing`, `/checkout`). For the tool to complete, +the site needs to do a hard navigation across these three pages before finally +submitting the checkout request to the server. + +## Cross-frame tool invocation + +[dresswear.com](http://dresswear.com) has a feature where the user can virtually +try on an item of clothing while on an item page. Because the try-on +application is expensive to load, it is created on-demand in a same-origin +`