tooluniverse.remote_tool 模块

远程工具实施

该模块提供了一个 RemoteTool 类,表示可供列出但无法在本地执行的外部 MCP/SMCP 工具。这些工具仅作为配置记录存储。

class tooluniverse.remote_tool.RemoteTool[源代码]

基类:BaseTool

用于外部 MCP/SMCP 工具的占位工具类。

RemoteTool 表示托管在外部 MCP/SMCP 服务器上的工具,仅用于发现和列出。这些工具无法通过 ToolUniverse 本地执行,但其配置会被保留以供参考。

tool_config

工具配置字典

类型:

dict

remote_info

有关远程服务器和工具的信息

类型:

dict

__init__(tool_config=None)[源代码]

初始化 RemoteTool。

参数:

tool_config (dict, optional) – 工具配置字典

run(arguments=None)[源代码]

用于远程工具的占位运行方法。

远程工具无法在本地执行。此方法始终返回一条错误消息,指示该工具不可用于本地执行。

参数:

arguments (dict, optional) – 工具参数(已忽略)

退货

dict: Error message indicating the tool is not available locally

get_remote_info()[源代码]

获取有关托管此工具的远程服务器的信息。

退货

dict: Remote server information including server type, URL, and original tool type

is_available_locally()[源代码]

检查此工具是否可用于本地执行。

退货

bool: Always False for RemoteTool instances

get_server_info()[源代码]

获取此远程工具的服务器连接信息。

退货

dict: Server connection details