INNER CODE UNIT · Python
tools
oneclickvirt/ecs · agent/server.py:128
def tools(self):
result = []
def add(name, description, spec=None, write=False, external=False):
result.append({"name": name, "description": description, "inputSchema": spec or schema(),
"annotations": {"readOnlyHint": not write, "destructiveHint": write,
"idempotentHint": not write, "openWorldHint": external}})
add("integration_info", "Show repository, supported operations, prerequisites and documentation.")
if self.profile.get("releases"):
add("release_assets", "Resolve a current published release and list its actual assets. No assumed architectures or tags.",
schema({"version": string("Exact release tag, or latest", pattern=r"[A-Za-z0-9_.+/-]{1,128}"),
"filter": string("Optional case-insensitive substring in asset names", maxLength=128)}), external=True)
backend = self.profile.get("runtime")
if backend:
add("list_instances", "List instances on this local runtime using its existing CLI.")
add("instance_status", "Read one instance's state without returning environment variables or cloud-init secrets.",
schema({"id": string(pattern=r"[A-Za-z0-9][A-Za-z0-9_.-]{0,127}")}, ["id"]))
if os.environ.get("ONECLICKVIRT_MCP_ALLOW_WRITE") == "1":
add("instance_action", "Start, gracefully stop or restart an explicitly named instance. No delete or reinstall operation.",