Skip to main content
Glama

Set service public firewall

set_service_public_firewall
DestructiveIdempotent

Replace an owned VPS or Cloud VPS public firewall and all incoming allow rules at the current generation, so new connections reach the server only where a rule permits. Use it to enable, disable or tighten public access.

Instructions

Replace the COMPLETE firewall of an owned server's public interface (VPS or Cloud VPS) at the generation read with get_service_public_firewall: enabled switches it on or off, rules is every incoming allow rule (at most limits.rules; a rule left out is removed). Free. Switched on, a new connection reaches the server only where a rule allows it (replies to connections the server opened, ICMP errors, neighbour discovery and DHCP still pass; outgoing traffic stays allowed); removing a rule refuses new connections at once but does not cut a session already open. Before switching it on or removing a rule, make sure management_ports stays open for the user's own address, and ask the user for that address. Switching on with no incoming rule needs acknowledge_no_incoming=true (every new connection is then refused). Outgoing rules are not offered. Refusals: 409 public_firewall_generation_conflict (read again), 409 public_firewall_unavailable with unavailable_reason (switching off is always accepted), 422 public_firewall_rule_limit, 422 with field rules.N. for a refused rule, 422 public_firewall_idempotency_key_reused, 423 while the server's two-factor lock is closed. A body equal to the stored one answers the current state and changes nothing. The answer reads state applying; poll get_service_public_firewall until state is applied (saved_for_start for a stopped server) or not_applied. client_address in the answer is the address the VPSnet API saw for this request: with this local package the public address of the machine that runs it, over a hosted connection the connector's gateway (returned there as null). It is never proof of the user's own address: ask the user which source address to allow before writing a rule with it. Requires explicit networking:read for reads or networking:manage for changes; full/read defaults do not grant networking. The backend enforces ownership, feature availability and service 2FA locks. Read current capabilities and owned resource state first; obtain approval for the exact change. An accepted operation is pending, not proof of connectivity. Poll the returned operation/resource on its in_progress flag, waiting next_check_seconds between reads: while in_progress is true its reason_code is what is awaited (reason_kind waiting, e.g. a queued or pending reason, or a control plane that has not answered yet), never an error; only in_progress false with reason_kind failure is a failure. Preserve reason_code. On transport uncertainty inspect state and reuse only the original key and unchanged request; never automatically retry.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "service_id": "<service_id>",
      "expected_generation": "<expected_generation>",
      "enabled": "<enabled>",
      "rules": "<rules>",
      "idempotencyKey": "<idempotencyKey>"
    },
    "name": "set_service_public_firewall"
  }
}

Input Schema

NameRequiredDescriptionDefault
rulesYes
enabledYes
service_idYes
idempotencyKeyYesIdempotency-Key for this exact change; preserve it and the unchanged body on uncertain recovery
expected_generationYes
acknowledge_no_incomingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.3.21

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description explains replacement semantics, immediate refusal of new connections versus existing sessions, what traffic still passes, error codes, two-factor lock behavior, idempotent reuse, and polling requirements. This is unusually rich behavioral context for a destructive mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core operation and its safety constraints are front-loaded, and nearly every sentence carries operational value. However, the description is very dense with long clauses and could be easier to scan with tighter grouping of error and recovery guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex destructive mutation with no output schema, the description covers the replacement model, permission requirements, acknowledgement flag, error handling, asynchronous polling, and idempotency recovery. An agent has enough context to invoke and recover from it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 17%, so the description carries much of the parameter burden: enabled toggles the firewall, rules are the complete incoming allow set with omitted rules removed, acknowledge_no_incoming is required under a specific condition, and expected_generation comes from the generation read. It does not explain every rule subfield, but it adds substantial meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb and resource: replacing the complete public-interface firewall of an owned server. It explicitly distinguishes the write operation from the generation read via get_service_public_firewall, so an agent can tell exactly what this tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit preconditions, permissions, and warnings: read the generation first, ensure management_ports remains open, ask the user for their source address, use acknowledge_no_incoming when enabling with no rules, and obtain approval for the exact change. It also names the read sibling and explains the lack of outgoing-rule support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools