# ModelContextProvider

WebMCP's tool-registration entry point, the value of `document.modelContext`
(Chrome origin trial, see https://webmachinelearning.github.io/webmcp/).

This is an interface exported by `@mapcairn/react`, checked against version 0.2.0.

## Signature

```ts
import type { ModelContextProvider } from "@mapcairn/react";
 
interface ModelContextProvider
```

## Properties

### registerTool

```ts
registerTool: (tool: {
        name: string;
        description: string;
        inputSchema: Record<string, unknown>;
        execute: (input: unknown) => Promise<ModelContextToolResult>;
    }, options?: {
        signal?: AbortSignal;
    }) => Promise<void>;
```

Registers a tool with the browser. It rejects, or throws, when the page's
Permissions-Policy denies tools or the schema is invalid. `options.signal`
removes the tool again when aborted.

## Remarks

The SDK does not add `modelContext` to the global `Document` type,
 because a global augmentation does not survive the built declarations.
 Type a stub or a read with this interface instead.

## See also

- [`ModelContextToolResult`](https://docs.mapcairn.com/api/react/ModelContextToolResult.md)

Source: [packages/react/src/hooks/useModelContextTool.ts:46](https://github.com/MapCairn/mapcairn/blob/main/packages/react/src/hooks/useModelContextTool.ts#L46)
