Skip to main content
Glama

配置服务器安全组/防火墙规则

configure_security_group
Destructive

Add or list inbound/outbound firewall rules for a Tencent Cloud CVM or Lighthouse instance. Specify region, instance ID, port, protocol, and policy to allow or block traffic.

Instructions

⚠️ 会真实修改云上防火墙配置。高层封装:在服务器控制台为指定实例添加一条入站/出站规则(放行或拒绝端口)。流程为:按地域打开实例列表 → 搜索 instanceId → 打开该实例的安全组/防火墙配置 → 切到对应方向 → 点"添加规则" → 填写来源/协议端口/策略/备注 → 提交 → 回读规则列表确认。product 可显式指定 cvm(云服务器安全组)或 lighthouse(轻量应用服务器防火墙);若不指定,会根据 instanceId 前缀自动判断(ins- 开头为 CVM,lhins- 开头为 Lighthouse)。port 支持单端口(80)、多端口(80,443)、端口段(8000-9000);protocol 为 TCP/UDP/ICMP/ALL,policy 为 ACCEPT/DROP。对 0.0.0.0/0 开放 22/3389/3306/6379 等高危端口时会返回风险提醒(仅提醒,不阻断)。改版导致界面变化时,会返回失败现场截图与手工步骤建议。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoadd=添加规则(默认);list=只读取并返回当前规则列表,不做任何修改。add
portYes端口,例如 "80"、"80,443,22"、"8000-9000"。
policyYesACCEPT=放行(允许),DROP=拒绝。
regionYes地域,例如 ap-guangzhou、ap-shanghai、ap-beijing。
cdpPortNo可选:CDP 调试端口。省略时沿用当前已连接的端口(从未连接过则为 9222)。
productNo可选:cvm 或 lighthouse,默认按 instanceId 前缀推断。
protocolYes协议,通常为 TCP 或 UDP。
directionNo可选:inbound=入站规则(默认),outbound=出站规则。inbound
instanceIdYes实例 ID,例如 ins-xxxxxxxx(CVM)或 lhins-xxxxxxxx(Lighthouse)。
sourceCidrNo可选:来源 IP/CIDR,默认 0.0.0.0/0(对全网开放)。
descriptionNo可选:规则备注,建议写明用途便于日后审计。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description discloses that the tool really modifies cloud firewall config, warns but does not block high-risk port exposals, and returns failure screenshots with manual steps when UI changes break the flow. This is exactly the kind of behavioral context annotations cannot express.

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 description is somewhat long, but the safety warning is front-loaded and every major behavior is economically explained. The enumerated UI workflow ('按地域打开实例列表…') is arguably more operational than necessary for an API-style wrapper, which keeps it from a perfect 5, but the density is justified for a destructive tool.

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

Completeness4/5

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

For a tool with 11 parameterstons of schema detail and no output schema, the description covers the key behavioral aspects: product inference, port syntax, risk reminders, and failure handling. However, the prose focuses on the 'add' path and does not mention the read-only 'list' mode, which the schema does document but the description could usefully surface.

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

Parameters5/5

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

Even though schema coverage is 100%, the description adds substantial meaning: product auto-inference from instanceId prefixes, supported port formats (single, comma-separated, ranges), protocol/policy value interpretations, and the risk reminder behavior for dangerous CIDR/port combinations. This goes well beyond the raw schema field names.

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 clearly states the tool's purpose: adding an inbound/outbound rule (allow or deny a port) to a specified instance's security group/firewall. It is also clearly distinct from the sibling browser-automation and DNS tools, naming the specific resource type (CVM vs Lighthouse) it operates on.

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

Usage Guidelines4/5

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

The description explains when to use the tool as a high-level wrapper, how product is inferred from instanceId, how to select direction, and the difference between add and read-only list modes. It does not explicitly say 'use this instead of interact_element' or enumerate when not to use it, but the context is strong enough for an agent to route correctly.

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