pub struct McpClientSet { /* private fields */ }Expand description
A fixed collection of initialized MCP clients and their startup-discovered tools.
Implementations§
Source§impl McpClientSet
impl McpClientSet
Sourcepub fn inspect_config_path(path: impl AsRef<Path>) -> Result<Value, McpError>
pub fn inspect_config_path(path: impl AsRef<Path>) -> Result<Value, McpError>
Parse and validate configuration without starting servers or exposing configured values.
Sourcepub fn from_config_path(path: impl AsRef<Path>) -> Result<Self, McpError>
pub fn from_config_path(path: impl AsRef<Path>) -> Result<Self, McpError>
Parse configuration, initialize every server, negotiate capabilities, and discover tools.
pub fn tool_schemas(&self) -> &[Value]
Sourcepub fn tool_schema(&self, tool_name: &str) -> Option<&Value>
pub fn tool_schema(&self, tool_name: &str) -> Option<&Value>
Return the exact OpenAI-compatible schema retained for an exposed MCP tool. The name is the collision-resistant host identity, not a model supplied alias.
Sourcepub fn surface_for_tool(
&self,
surface_id: impl Into<String>,
tool_name: &str,
state_digest: impl Into<String>,
) -> Result<Option<Surface>, McpError>
pub fn surface_for_tool( &self, surface_id: impl Into<String>, tool_name: &str, state_digest: impl Into<String>, ) -> Result<Option<Surface>, McpError>
Build a trusted GenUI form from the original MCP input schema. This does not grant permission or invoke the tool.
Sourcepub fn prepare_genui_surface(
&self,
_surface_id: impl Into<String>,
_session_id: &str,
_principal: &str,
_tool_name: &str,
_state_digest: impl Into<String>,
) -> Result<Option<(Surface, ActionCatalog)>, McpError>
pub fn prepare_genui_surface( &self, _surface_id: impl Into<String>, _session_id: &str, _principal: &str, _tool_name: &str, _state_digest: impl Into<String>, ) -> Result<Option<(Surface, ActionCatalog)>, McpError>
Create a host-bound presentation and catalog entry for one discovered route. The opaque action ID is generated by the host adapter, while the provider/session/principal/schema identity is retained privately.
Sourcepub fn prepare_genui_surface_with_store(
&self,
store: &EventStore,
surface_id: impl Into<String>,
session_id: &str,
principal: &str,
tool_name: &str,
) -> Result<Option<(Surface, ActionCatalog)>, McpError>
pub fn prepare_genui_surface_with_store( &self, store: &EventStore, surface_id: impl Into<String>, session_id: &str, principal: &str, tool_name: &str, ) -> Result<Option<(Surface, ActionCatalog)>, McpError>
Create a host-bound GenUI presentation from the durable Agent/session state. A caller-provided surface digest is never treated as current authority; the state row is the only source for generation and digest.
Sourcepub fn validate_tool_arguments(
&self,
tool_name: &str,
arguments: &Value,
) -> Result<(), McpError>
pub fn validate_tool_arguments( &self, tool_name: &str, arguments: &Value, ) -> Result<(), McpError>
Fail closed against the original MCP schema before a GenUI-bound call is handed to the existing authenticated MCP transport.
Sourcepub fn execute_validated(&self, call: &ToolCall) -> Option<ToolResult>
pub fn execute_validated(&self, call: &ToolCall) -> Option<ToolResult>
Canonical model-facing MCP gate. Read-only calls are schema-validated and routed to the private transport seam; consequential calls return a structured confirmation requirement and never reach the transport.
Sourcepub fn execute(&self, call: &ToolCall) -> Option<ToolResult>
pub fn execute(&self, call: &ToolCall) -> Option<ToolResult>
Public compatibility entry point for ordinary read-only MCP calls. It is an authority gate, never a raw transport executor.
pub fn handles(&self, tool_name: &str) -> bool
pub fn may_mutate(&self, tool_name: &str) -> bool
pub fn set_tool_policy( &mut self, tool_name: &str, policy: ToolPolicy, ) -> Result<(), McpError>
pub fn tool_identity(&self, tool_name: &str) -> Option<(&str, &str, &str)>
pub fn validate_tool_identity( &self, tool_name: &str, provider_id: &str, schema_digest: &str, ) -> Result<(), McpError>
pub fn validate_tool_identity_full( &self, tool_name: &str, provider_id: &str, server_id: &str, schema_digest: &str, policy_version: u64, policy_digest: &str, ) -> Result<(), McpError>
pub fn tool_policy_identity( &self, tool_name: &str, ) -> Option<(u64, String, bool)>
Sourcepub fn live_tool_identity(&self, tool_name: &str) -> Option<LiveToolIdentity>
pub fn live_tool_identity(&self, tool_name: &str) -> Option<LiveToolIdentity>
Query the current route, schema, and policy identity from the same registry used by execution. No cached GenUI/catalog state is consulted.
Sourcepub fn live_registry_digest(&self) -> String
pub fn live_registry_digest(&self) -> String
Stable digest of the live MCP registry/source authority. It covers every exposed route, remote identity, schema, policy, and confirmation field used by admission and execution.
Sourcepub fn live_registry_generation(&self) -> u64
pub fn live_registry_generation(&self) -> u64
Monotonic live-registry generation used as a publication CAS token. The digest remains the authoritative content check; this token closes ABA-style mutation windows where a route could be changed and restored between two reads.
Sourcepub fn discovery_metadata(&self) -> Value
pub fn discovery_metadata(&self) -> Value
Return non-secret startup provenance suitable for durable event history.