pub trait SessionToolFactory: Send + Sync {
// Required method
fn build_registry(
&self,
cwd: PathBuf,
mcp_servers: Vec<McpServer>,
) -> BoxFuture<'_, Result<Arc<dyn ToolRegistry>, BoxError>>;
}Expand description
Abstraction for building an additional tool registry for a single session.
A typical implementation comes from defect-mcp: it connects to the list of MCP
servers provided by session/new or session/load, and wraps the remote tools into a
ToolRegistry.
Required Methods§
Sourcefn build_registry(
&self,
cwd: PathBuf,
mcp_servers: Vec<McpServer>,
) -> BoxFuture<'_, Result<Arc<dyn ToolRegistry>, BoxError>>
fn build_registry( &self, cwd: PathBuf, mcp_servers: Vec<McpServer>, ) -> BoxFuture<'_, Result<Arc<dyn ToolRegistry>, BoxError>>
Build a session-level tool registry for the current session.
§Errors
Returns an error if the external tool source fails to initialize, the remote inventory cannot be fetched, or the configuration is unsupported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".