INNER CODE UNIT · Python

add

oneclickvirt/ecs · agent/server.py:130

        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.",
                    schema({"id": string(pattern=r"[A-Za-z0-9][A-Za-z0-9_.-]{0,127}"),
                            "action": string(enum=["start", "stop", "restart"])}, ["id", "action"]), write=True)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…