tooluniverse.remote_tool module¶
Remote Tool Implementation
This module provides a RemoteTool class that represents external MCP/SMCP tools that are available for listing but cannot be executed locally. These tools are stored as configuration records only.
- class tooluniverse.remote_tool.BaseTool(tool_config)[source][source]¶
Bases:
object
- classmethod get_default_config_file()[source][source]¶
Get the path to the default configuration file for this tool type.
This method uses a robust path resolution strategy that works across different installation scenarios:
Installed packages: Uses importlib.resources for proper package resource access
Development mode: Falls back to file-based path resolution
Legacy Python: Handles importlib.resources and importlib_resources
Override this method in subclasses to specify a custom defaults file.
- Returns:
Path or resource object pointing to the defaults file
- tooluniverse.remote_tool.register_tool(tool_type_name=None, config=None)[source][source]¶
Decorator to automatically register tool classes and their configs.
- Usage:
@register_tool(‘CustomToolName’, config={…}) class MyTool:
pass
- class tooluniverse.remote_tool.RemoteTool(tool_config=None)[source][source]¶
Bases:
BaseTool
A placeholder tool class for external MCP/SMCP tools.
RemoteTool represents tools that are hosted on external MCP/SMCP servers and are only available for discovery and listing purposes. These tools cannot be executed locally through ToolUniverse but their configurations are preserved for reference.
- __init__(tool_config=None)[source][source]¶
Initialize the RemoteTool.
- Parameters:
tool_config (dict, optional) – Tool configuration dictionary
- run(arguments=None)[source][source]¶
Placeholder run method for remote tools.
Remote tools cannot be executed locally. This method always returns an error message indicating that the tool is not available for local execution.
- get_remote_info()[source][source]¶
Get information about the remote server hosting this tool.
- Returns:
Remote server information including server type, URL, and original tool type
- Return type: