Skip to main content
Glama

unifi_create_dns_policy

Create a local DNS record or forward domain on UniFi for A, AAAA, CNAME, MX, SRV, or TXT entries. Guarded changes require confirm: true and preview risky hostname mismatches first.

Instructions

Create a DNS policy (official POST /dns/policies): a local A, AAAA, CNAME, MX, SRV or TXT record, or a forward domain. Easy: DNS records do not filter traffic. When UNIFI_URL names the console by hostname, a record for that hostname, or a forward of it or a parent domain, can send unifi-mcp elsewhere, so it needs confirm: true and previews first.

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": {
      "type": "<type>",
      "domain": "<domain>"
    },
    "name": "unifi_create_dns_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
portNoSRV_RECORD: the port
siteNoSite name, id or reference; optional while the console has a single site
textNoTXT_RECORD: the text
typeYesRecord type
domainYesThe domain the record is for
weightNoSRV_RECORD: the weight
confirmNoMust be true to carry out a guarded change; without it the tool only previews it
enabledNoWhether the record is served
serviceNoSRV_RECORD: the service
priorityNoMX/SRV_RECORD: the priority
protocolNoSRV_RECORD: the protocol
ipAddressNoFORWARD_DOMAIN: the DNS server to forward to
ttlSecondsNoTime to live (A, AAAA, CNAME)
ipv4AddressNoA_RECORD: the IPv4 address
ipv6AddressNoAAAA_RECORD: the IPv6 address
serverDomainNoSRV_RECORD: the server
targetDomainNoCNAME_RECORD: the target
mailServerDomainNoMX_RECORD: the mail server

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare non-read-only, non-destructive, non-idempotent and closed-world, so the safety profile is already carried. The description adds real substance beyond that: DNS records do not filter traffic (impact scope), and the guarded-change flow where confirm: true is required and omitted calls only preview. It overlaps somewhat with the confirm parameter's own schema text, which costs it a point.

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?

Three sentences, front-loaded with purpose before the conditional hazard. Mostly efficient, though the 'Easy:' framing and the parenthetical endpoint reference are slightly conversational filler rather than information the agent needs to act.

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 an 18-parameter creation tool with no output schema, the definition covers purpose, the record-type surface, and the one behavioral trap (hostname/forward targets redirecting the MCP server itself). The schema handles per-field meaning, and annotations handle the safety profile, so nothing needed to invoke correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100% and every parameter already carries type-specific documentation ('SRV_RECORD: the port', 'MX_RECORD: the mail server'), so the baseline is 3. The description reinforces which record types the enum covers but adds no syntax, format, or interaction detail 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?

States a specific verb and resource ('Create a DNS policy') and immediately enumerates the supported record types (A, AAAA, CNAME, MX, SRV, TXT, forward domain), plus the underlying API endpoint. An agent can distinguish this from unifi_update_dns_policy or unifi_delete_dns_policy on the verb alone, with no ambiguity about what gets created.

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?

Gives a conditional rule: when UNIFI_URL names the console by hostname, creating a record for that hostname (or forwarding it/a parent domain) requires confirm: true and previews first. That is real when-to-use-condition guidance. It stops short of naming the sibling tools (update/delete) as alternatives for other cases, so it is not full alternative routing.

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