pub struct ToolProxy { /* private fields */ }Expand description
A tool-proxy that wraps multiple servers behind a single call_tool.
Implementations§
Source§impl ToolProxy
impl ToolProxy
pub fn new( name: String, members: HashSet<String>, tool_dir: PathBuf, server_descriptions: &[(String, String)], ) -> Self
pub fn name(&self) -> &str
Sourcepub fn contains_server(&self, server_name: &str) -> bool
pub fn contains_server(&self, server_name: &str) -> bool
Whether server_name is a nested member of this proxy.
Sourcepub fn is_call_tool(&self, namespaced_tool_name: &str) -> bool
pub fn is_call_tool(&self, namespaced_tool_name: &str) -> bool
Whether a namespaced tool name refers to this proxy’s call_tool.
Sourcepub fn resolve_call(&self, arguments_json: &str) -> Result<ResolvedCall>
pub fn resolve_call(&self, arguments_json: &str) -> Result<ResolvedCall>
Parse and validate a proxy call_tool invocation.
pub fn instructions(&self) -> &str
pub fn tool_dir(&self) -> &Path
Sourcepub fn add_member(&mut self, server_name: String)
pub fn add_member(&mut self, server_name: String)
Register a new member server (e.g. after late OAuth registration).
Sourcepub fn dir(name: &str) -> Result<PathBuf, McpError>
pub fn dir(name: &str) -> Result<PathBuf, McpError>
Returns the directory for a tool-proxy’s tool definitions.
Uses $AETHER_HOME/tool-proxy/<name> or ~/.aether/tool-proxy/<name>.
Sourcepub async fn clean_dir(tool_dir: &Path) -> Result<(), McpError>
pub async fn clean_dir(tool_dir: &Path) -> Result<(), McpError>
Clean up the tool directory for a proxy, removing all tool files.
Sourcepub fn call_tool_schema() -> Arc<Map<String, Value>>
pub fn call_tool_schema() -> Arc<Map<String, Value>>
Build the call_tool JSON schema used by the proxy’s virtual tool.
Sourcepub fn call_tool_definition(proxy_name: &str) -> ToolDefinition
pub fn call_tool_definition(proxy_name: &str) -> ToolDefinition
Build a ToolDefinition for the proxy’s call_tool virtual tool.
Sourcepub async fn write_tools_to_dir(
server_name: &str,
client: &RunningService<RoleClient, McpClient>,
tool_dir: &Path,
) -> Result<(), McpError>
pub async fn write_tools_to_dir( server_name: &str, client: &RunningService<RoleClient, McpClient>, tool_dir: &Path, ) -> Result<(), McpError>
Discover tools from a connected MCP server and write them as JSON files
to tool_dir/<server_name>/.
Sourcepub fn extract_server_description(
client: &RunningService<RoleClient, McpClient>,
server_name: &str,
) -> String
pub fn extract_server_description( client: &RunningService<RoleClient, McpClient>, server_name: &str, ) -> String
Extract a one-line description for a nested server from its peer info.
Uses server_info.description, falling back to the server name.