Skip to main content
Glama

create_dfw_rule

Create a distributed firewall rule under an existing DFW security policy. Set policy ID, rule ID, display name, and optional sources, destinations, services, and action to control traffic.

Instructions

[WRITE] Create a firewall rule under an existing DFW security policy.

Returns the created rule dict (id, path, action, ...), else {"error", "hint"}; a bad action/direction/ip_protocol lists the valid values. PUT semantics: reusing a rule_id overwrites that rule, enforced immediately unless disabled=True. Pick policy_id with list_dfw_policies first; prefer update_dfw_rule to edit one and delete_dfw_rule to remove one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoApplied-to group/segment paths; omit for the whole DFW.
actionNoALLOW, DROP, REJECT or JUMP_TO_APPLICATION (default ALLOW); JUMP_TO_APPLICATION needs an Environment policy.ALLOW
loggedNoLog matched traffic (default False).
targetNoTarget name from config; default if omitted.
rule_idYesUnique rule id within that policy.
sourcesNoSource group paths like ['/infra/domains/default/groups/web']; omit for any.
disabledNoCreate the rule unenforced (default False).
servicesNoService paths; omit for all.
directionNoIN, OUT or IN_OUT (default IN_OUT).IN_OUT
policy_idYesParent policy id, from list_dfw_policies.
descriptionNoOptional free text.
ip_protocolNoIPV4, IPV6 or IPV4_IPV6 (default IPV4_IPV6).IPV4_IPV6
destinationsNoDestination group paths; omit for any.
display_nameYesHuman-readable name.
sequence_numberNoPriority; lower matches first (default 10).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changedv1.10.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / action / description
      Added value: +"ALLOW, DROP, REJECT or JUMP_TO_APPLICATION (default ALLOW); JUMP_TO_APPLICATION needs an Environment policy."
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "ALLOW",
      +  "DROP",
      +  "REJECT",
      +  "JUMP_TO_APPLICATION"
      +]
    • addedInput schema / properties / description / description
      Added value: +"Optional free text."
    • addedInput schema / properties / destinations / description
      Added value: +"Destination group paths; omit for any."
    • addedInput schema / properties / direction / description
      Added value: +"IN, OUT or IN_OUT (default IN_OUT)."
    • addedInput schema / properties / direction / enum
      Added value: +[
      +  "IN",
      +  "OUT",
      +  "IN_OUT"
      +]
    • addedInput schema / properties / disabled / description
      Added value: +"Create the rule unenforced (default False)."
    • addedInput schema / properties / display_name / description
      Added value: +"Human-readable name."
    • addedInput schema / properties / ip_protocol / description
      Added value: +"IPV4, IPV6 or IPV4_IPV6 (default IPV4_IPV6)."
    • addedInput schema / properties / ip_protocol / enum
      Added value: +[
      +  "IPV4",
      +  "IPV6",
      +  "IPV4_IPV6"
      +]
    • addedInput schema / properties / logged / description
      Added value: +"Log matched traffic (default False)."
    • addedInput schema / properties / policy_id / description
      Added value: +"Parent policy id, from list_dfw_policies."
    • addedInput schema / properties / rule_id / description
      Added value: +"Unique rule id within that policy."
    • addedInput schema / properties / scope / description
      Added value: +"Applied-to group/segment paths; omit for the whole DFW."
    • addedInput schema / properties / sequence_number / description
      Added value: +"Priority; lower matches first (default 10)."
    • addedInput schema / properties / services / description
      Added value: +"Service paths; omit for all."
    • addedInput schema / properties / sources / description
      Added value: +"Source group paths like ['/infra/domains/default/groups/web']; omit for any."
    • addedInput schema / properties / target / description
      Added value: +"Target name from config; default if omitted."
  2. Addedv1.5.29
  3. Removedv1.5.28
  4. First observedv1.3.2

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the exact return shape for success and failure, error hints for invalid enums, overwrite semantics for duplicate rule_id, and the immediate-enforcement behavior unless disabled=True. These are behavioral details not available in the schema or annotations.

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

Conciseness5/5

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

Three sentences carry all the essential guidance with no filler, and the purpose is front-loaded in the first sentence. Each sentence earns its place: return shape, overwrite behavior, and sibling routing.

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 15-parameter write tool with no output schema, the description covers return value, error format, validation hints, upsert semantics, prerequisite discovery, and alternative tools. Nothing essential for selecting and invoking this tool is missing.

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?

The schema already documents all 15 parameters (100% coverage), so the baseline is 3. The description adds useful semantics by explaining that policy_id must come from list_dfw_policies and that reusing rule_id overwrites the existing rule, enriching the meaning of those parameters beyond their schema descriptions.

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 specific verb and resource, 'Create a firewall rule under an existing DFW security policy,' which immediately distinguishes it from update_dfw_rule, delete_dfw_rule, and create_dfw_policy. The sibling tools are explicitly named where relevant, reinforcing the differentiation.

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 instructs the agent to pick policy_id with list_dfw_policies first, and explicitly names update_dfw_rule and delete_dfw_rule as the alternatives for editing and removal. The PUT-semantics warning about overwriting on reused rule_id also tells the agent when creation acts as an upsert.

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