AbortSignal:
Registration lifetime
Replace a registration
toolchange event lets consumers refresh
their catalog after registration or cleanup.
See Build your first React tool and the
WebMCP API sources.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Hackathon: OpenAI WebMCP Challenge. Build an agent-native web app. Submissions close September 3 at 1 p.m. PT.
Why WebMCP tools must be registered, replaced, and removed as page context changes.
AbortSignal:
const controller = new AbortController();
await document.modelContext.registerTool(tool, { signal: controller.signal });
// Remove the registration during route or component cleanup.
controller.abort();
controller.abort();
const nextController = new AbortController();
await document.modelContext.registerTool(nextTool, {
signal: nextController.signal,
});
toolchange event lets consumers refresh
their catalog after registration or cleanup.
See Build your first React tool and the
WebMCP API sources.Was this page helpful?
