Skip to main content

Contact

What are you interested in?

Back to Glossary (N)
Glossary · N

navigator.modelContext.

navigator.modelContext is the browser JavaScript API behind WebMCP. With registerTool() a website provides tools for AI agents, and with unregisterTool() it removes them again.

NAGLOSSARYDLM Digital

navigator.modelContext — Explained in Detail

navigator.modelContext is the client-side interface through which a website makes its actions available to AI agents. The central call is registerTool(): it passes an object with name, description, inputSchema (JSON Schema) and an execute function that performs the action and returns a result in the format { content: [{ type: 'text', text: '…' }] }.

unregisterTool(name) removes a tool again — important in single-page apps where the available actions change per page. The previously discussed methods provideContext() and clearContext() were removed from the specification in March 2026.

Feature detection uses the check 'modelContext' in navigator. Because the API is still experimental in 2026, it is added as a progressive enhancement: if it is not present, the site simply registers no tools — without errors and without affecting normal visitors.

Frequently Asked Questions About navigator.modelContext

With navigator.modelContext.registerTool() and an object consisting of name, description, inputSchema and an execute function. The agent recognises the tool by its name and description and calls it with the parameters defined in the schema.

An object in the format { content: [{ type: 'text', text: '…' }] }. The text is the result the agent reports back to the user — for example a confirmation that the request has been sent.

Ready for Your Project?

Apply this knowledge to your website — DLM Digital will help you.