# UiToolProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-mcp/trait-uitoolprovider/

**trait** · [`ferroui-mcp`](/docs/0.5.0/api/ferroui-mcp/) · v0.5.0

```rust
trait UiToolProvider
```

An application-owned set of MCP tools. Every method runs on the creating UI thread.

The provider can hold `Rc`, controls, designer sessions, and other non-`Send` state. Only
its immutable tool descriptions and numeric registration identity cross to transport threads.
Descriptions are snapshotted when the server starts; restart to change the catalog. Tool
names must not shadow the inspector. All tools without `readOnlyHint: true` additionally
require `Options::permissions.allow_property_writes` before the provider is invoked.
Providers must describe mutating tools accurately and also check `allow_input` for any
tool that synthesizes input; input permission remains independent of authoring permission.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Mcp/extensions.rs#L21)

## Members

- [`tools`](#function-tools)
- [`validate`](#function-validate)
- [`call`](#function-call)

<a id="function-tools"></a>

### tools

```rust
fn tools(self: &Self) -> Vec<Value>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Mcp/extensions.rs#L22)

<a id="function-validate"></a>

### validate

```rust
fn validate(self: &Self, name: &str, arguments: &Value) -> Result<(), String>
```

Validate typed arguments before reading or changing application state.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Mcp/extensions.rs#L24)

<a id="function-call"></a>

### call

```rust
fn call(self: &Self, name: &str, arguments: &Value, permissions: Permissions) -> Result<Value, String>
```

Return JSON data, or a PNG image using the inspector's existing envelope:
`{ "mimeType": "image/png", "data": "<base64>", ...metadata }`.
Native transports emit that envelope as an MCP image content block and
preserve any additional fields as structured/text metadata. No file is saved.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Mcp/extensions.rs#L29)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
