UiToolProvider
trait · ferroui-mcp · v0.5.0
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.
Members
tools
fn tools(self: &Self) -> Vec<Value>
validate
fn validate(self: &Self, name: &str, arguments: &Value) -> Result<(), String>
Validate typed arguments before reading or changing application state.
call
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.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.