pub struct ConnectorTool {
pub name: String,
pub title: Option<String>,
pub description: Option<String>,
pub input_schema: Value,
pub read_only_hint: Option<bool>,
pub destructive_hint: Option<bool>,
pub resource_uri: Option<String>,
pub app_only: bool,
pub model_only: bool,
pub raw: Value,
}Expand description
One tool of an MCP server.
Fields§
§name: String§title: Option<String>annotations.title, else title.
description: Option<String>§input_schema: ValueJSON Schema for the arguments (inputSchema).
read_only_hint: Option<bool>§destructive_hint: Option<bool>§resource_uri: Option<String>MCP Apps: the ui:// resource that shows its results (_meta.ui.resourceUri).
app_only: boolMCP Apps visibility: hidden from the model (visibility without "model").
model_only: boolNot callable from the server’s apps (visibility without "app").
raw: ValueThe entry as the server listed it (null if unknown).
Implementations§
Source§impl ConnectorTool
impl ConnectorTool
Sourcepub fn from_mcp(v: &Value) -> Option<Self>
pub fn from_mcp(v: &Value) -> Option<Self>
From one entry of MCP tools/list → tools. None without a usable name.
Sourcepub fn read_only(&self) -> bool
pub fn read_only(&self) -> bool
Only reads: says so (readOnlyHint), or gives no hints and its name only reads
(get_issue, searchDocs). MCP’s default for a tool without hints is “may change
things”.
Sourcepub fn needs_approval(&self, untrusted: bool) -> bool
pub fn needs_approval(&self, untrusted: bool) -> bool
Should the user approve each call? Hob’s rule: everything that isn’t read-only, unless it says it isn’t destructive and nothing untrusted entered the task.