Trait McpToolTransport
pub trait McpToolTransport: Send + Sync {
// Required methods
fn list_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<McpToolDefinition>, McpTransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn call_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
progress_tx: Option<UnboundedSender<McpProgressUpdate>>,
) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpTransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn transport_type(&self) -> TransportTypeId;
// Provided method
fn read_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, McpTransportError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
}Required Methods§
fn list_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<McpToolDefinition>, McpTransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn call_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
progress_tx: Option<UnboundedSender<McpProgressUpdate>>,
) -> Pin<Box<dyn Future<Output = Result<CallToolResult, McpTransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn transport_type(&self) -> TransportTypeId
Provided Methods§
fn read_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, McpTransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn read_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
_uri: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value, McpTransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Read a resource by URI (e.g. ui://... for MCP Apps).
Returns the raw JSON value from the resources/read response.