Developer finds WebMCP feature detection unreliable after shipping parliamentary-procedure tool
A developer spent eight days building a parliamentary-procedure engine called Point of Order using WebMCP, the emerging standard that lets web pages expose typed tool lists to AI agents via document.modelContext. During testing across clients, they discovered that checking for the presence of 'registerTool' in modelContext does not confirm the full API works — ChatGPT's in-app browser registered tools correctly but threw a TypeError when addEventListener was called, since its modelContext is not an EventTarget. This meant subscribing to tool-change events and registering tools are separate capabilities, with no warning in the object's shape, causing the app to render successfully before announcing a startup failure. A second issue emerged with WebMCP's declarative form, where DOM-based tool adoption offers no promise to await, causing getTools() to return stale counts when polled too early in clients lacking toolchange event support. The developer's fixes include treating each capability as independently optional, surfacing specific failure details in the UI, and polling until the tool surface stabilises in clients without event support.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in