The Events list in my React application exposed no WebMCP tools. The event editor exposed four.Both results were intentional. Together, they revealed the harder question: how does an agent reach an operation that only exists after the correct page is open?A person can click Events, create a draft, and continue. A browser agent with navigation and actuation can take a similar path. A client restricted to WebMCP tool calls cannot make the first move through an interface that currently contains no tools.Page-scoped tools make the editing context explicit. They also make access to that context part of the product design. I created and maintain Trip Workbench, the public React and TypeScript demo used for this experiment. The recorded browser run used synthetic data and scripted tool choices. It tested the actual registered interface and persisted results; it did not measure whether a language model worked faster or more accurately.Two Workflows Should Not Pretend to Be OneThe trip editor handles airports, travel dates, cabin, traveler count, and purpose. The event editor handles a title, date range, time zone, location, and notes.Both use sessions, optimistic revisions, command receipts, and policy findings. They do not share an object identity. Events have an event coordinator, service, tables, validation rules, and policy version. Trips have their own.The trip interface offers five operations: read, update, validate, prepare a review, and recheck an uncertain update. The event interface offers four: read, update, validate, and prepare.I could have registered all nine globally with generic names such as update_current_item. That would make the agent infer whether “current” meant a trip or an event, and it would make every route carry operations the user could not see.Instead, each tool keeps its domain name and identifier. Event tools accept eventId; trip tools accept draftId.What a Narrower Interface BuysThe event editor registers its tools only after the draft identity and status are known. It gives the registration an abort signal that is triggered on React cleanup:useEffect(() => { if (!eventId || draftStatus !== "draft") return; const registration = new AbortController(); registerEventDraftTools({ eventId, canMutate, coordinator, signal: registration.signal, }); return () => registration.abort(); }, [eventId, draftStatus, canMutate, coordinator]); This makes the editor itself part of the contract. The handler can consult the same coordinator as the form, and a result can appear beside the fields the person is editing.The current WebMCP imperative API supports abort-signal registration lifecycles. Chrome 153 also separates unregistering a tool from cancelling an already-running execution. That distinction matters: removing a tool during a route change should not unexpectedly terminate an operation, but the application still needs to guard late results from changing the wrong editor.The useful boundary is not a magic tool-count threshold. It is the relationship between a visible workflow, a precise schema, an authorized actor, and a handler bound to the same object.Test the Interface Across Routes and RolesThe native run signed in through the ordinary form, used the visible Events navigation, created a synthetic event, and inspected the real WebMCP tool collection.It observed this sequence:Traveler on the Trips list: no tools.Traveler on the Events list: no tools.Traveler editing an event: four event tools.Traveler editing a trip: five trip tools.Traveler returning to the Events list: no tools.Traveler reopening the event: four event tools.Observer editing the event: read, validate, and prepare.Observer returning to the list: no tools.The empty state after navigation is as important as the non-empty editor state. It catches registrations that survive React cleanup. The observer test checks a presentation boundary: the mutation operation is absent. It does not prove authorization. The server must still reject an update from an actor without permission, because tool metadata and browser code are inputs—not a security perimeter.Discovery proves exposure, not usefulness. The test also updated a synthetic workshop, validated it, and prepared a review.The update changed the event to “Customer engineering workshop,” set dates and a time zone, and selected a manual location. The accepted command advanced the event from revision 1 to 2.Preparation returned a MANUAL_LOCATION review requirement with canSubmit: true and submitted: false. The visible title matched an independent saved-state query. The database still showed status draft and zero submissions.That cross-surface agreement matters:WebMCP result | +----> React editor: revision 2, workshop title | +----> Database: revision 2, same title, draft | +----> Submission records: 0 The public event example does not send invitations, connect calendars, or book venues. Its result should never imply otherwise.WebMCP’s current specification defines semantic annotations and cross-origin exposure controls. Chrome’s security guidance recommends preserving normal authorization and treating tool outputs and external text as potentially untrusted.Those mechanisms help agents reason about tools. They do not turn discovery into permission.For every mutation, the application still needs to answer:Which authenticated actor is calling?Can that actor access this object?Is the expected revision current?Is the operation still valid in the active editor and session?If the response arrives late, does it still belong to this context?Omitting a submit tool is similarly limited. It narrows the WebMCP surface, but a broader browser agent might still actuate an ordinary button. Consequential routes must defend themselves.Keep a Way Into the WorkflowThe list route has no editor tools, so the event tools cannot open their own context. The recorded run used normal navigation and the “New event draft” button. That is sufficient for a person and for a browser agent that can navigate the UI. It is incomplete for a tool-only client.I see two honest options.The first is to document browser navigation as part of the client contract. The agent uses links or actuation until an editor exists, then switches to structured tools.The second is to expose a narrow list-level operation such as open_event_draft or create_event_draft. Its result should identify the authorized draft and the new context. It should not silently choose somebody else’s object.I would not add “run arbitrary JavaScript” or “call any endpoint” to bridge the gap. Those escape hatches discard the schemas and server checks that made the page tools reviewable.Route Cleanup Does Not Solve In-Flight CorrectnessAborting the registration removed event tools during the observed route transitions. An operation that already reached the server creates a different problem.A late response must not update a new draft merely because the same component type is mounted. The coordinator needs context guards such as draft ID, revision, session generation, editor generation, and operation identity.Trip Workbench’s later reliability pass strengthens those guards for trip recovery and prepared-review races. The event coordinator still needs its own equivalent fault-injection coverage. Reusing an architectural pattern is not evidence that every implementation has inherited its behavior.Four visible tools may look cleaner than nine, but discovery counts do not tell us whether a model performs better.A defensible evaluation would keep task behavior constant while varying the visible interface. It would include unrelated and similarly named tools plus tasks that must cross from a list into an editor.I would record:failures to reach the workflow;wrong-target mutations;correct saved outcomes;policy or submission claims that contradict the database;recovery steps and retries;final-answer accuracy.The initial browser evidence did not run that experiment. It supports a smaller conclusion: route and role changed the discovered interface exactly as designed, a useful event operation reached both UI and database, and cleanup removed the tools when the context ended.That is enough to guide architecture without turning tool count into a performance claim.The interface an agent sees should be no broader than the workflow it can explain and no narrower than the path it must complete.
How Much of an Application Should an AI Agent See
Full Article
Original Source
Read the full article at Hackernoon →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.