> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcp-b.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool lifecycle and dynamic registration

> Why WebMCP tools must be registered, replaced, and removed as page context changes.

A site's valid actions change with route, selected record, permissions, and
workflow state. The published tool set should change with them.

Agents should see only actions that are currently
meaningful and authorized, with descriptions and schemas that match the active
application context.

The current registration pattern ties a tool to an `AbortSignal`:

```ts theme={null}
const controller = new AbortController();
document.modelContext.registerTool(tool, { signal: controller.signal });

// Remove the registration during route or component cleanup.
controller.abort();
```

Descriptions and schemas must be replaced when application context changes;
stale or duplicate registrations make discovery ambiguous. Tool-change
notifications allow consumers to refresh the catalog after registration or
cleanup.

See [Build your first React tool](/tutorials/first-react-tool) and the
[WebMCP standard API](/reference/webmcp/standard-api).
