Skip to main content
Glama

Create or update DNS record

upsert_dns_record
DestructiveIdempotent

Set exactly one DNS record of a given type for a host: update the existing record or create it if missing, and fail without changes when duplicates already exist.

Instructions

Make sure a host has exactly this record of the given type: updates the existing record for that host and type, or creates one if there is none. When updating, optional fields you leave out (e.g. ttl, priority) keep their stored value. Fails without changing anything if the host already has several records of that type (common for MX and TXT); then use patch_dns_record with a record_id, or create_dns_record to add another. Returns { action: "created" | "updated", record }.

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": {
      "domain_id": "<domain_id>",
      "host": "<host>",
      "type": "<type>",
      "data": "<data>"
    },
    "name": "upsert_dns_record"
  }
}

Input Schema

NameRequiredDescriptionDefault
algNorequired for DS: the DNSSEC signing algorithm number, 0-255
tagNorequired for DS as a number (the key tag 0-65535 of the referenced DNSKEY) and for CAA as a string (the property tag, e.g. issue, issuewild or iodef)
ttlNotime-to-live in seconds, 60-604800, must be a multiple of 60, defaults to 3600
dataYesthe record's main value: an IPv4 address for A, an IPv6 address for AAAA, a hostname for ANAME/CNAME/MX/NS/SRV, free text for TXT, the CAA property value, or the hex hash for DS/TLSA
hostYesthe host/subdomain the record applies to, e.g. 'www' or '@' for the root
portNorequired for SRV: the port 0-65535 the service is found on
typeYesthe record type
dtypeNorequired for TLSA: matching type of the hash in data (0 exact match, 1 SHA-256, 2 SHA-512)
flagsNorequired for CAA: 128 to mark the property critical, otherwise 0
usageNorequired for TLSA: certificate usage (0 PKIX-TA, 1 PKIX-EE, 2 DANE-TA, 3 DANE-EE)
digestNorequired for DS: digest type of the hash in data (1 SHA-1, 2 SHA-256, 4 SHA-384)
weightNorequired for SRV: relative weight 0-65535 among records with the same priority
priorityNorequired for MX and SRV: preference value 0-65535, lower is tried first
selectorNorequired for TLSA: what the hash is taken from (0 full certificate, 1 subject public key)
domain_idYesthe Domeneshop domain ID, from list_domains

Output Schema

NameRequiredDescriptionDefault
actionYes
recordYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.7
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed27 schema fields changedv2.0.0
    • changedInput schema / properties / alg / description
      Previous value: -"required for DS: the DNSSEC signing algorithm number"New value: +"required for DS: the DNSSEC signing algorithm number, 0-255"
    • changedInput schema / properties / alg / maximum
      Previous value: -9007199254740991New value: +255
    • changedInput schema / properties / alg / minimum
      Previous value: --9007199254740991New value: +0
    • changedInput schema / properties / data / description
      Previous value: -"the record's main value: an IP address for A/AAAA, a hostname for ANAME/CNAME/MX/NS/SRV, free text for TXT, the CAA property value, or the hex hash for DS/TLSA"New value: +"the record's main value: an IPv4 address for A, an IPv6 address for AAAA, a hostname for ANAME/CNAME/MX/NS/SRV, free text for TXT, the CAA property value, or the hex hash for DS/TLSA"
    • addedInput schema / properties / data / minLength
      Added value: +1
    • changedInput schema / properties / digest / maximum
      Previous value: -9007199254740991New value: +255
    • changedInput schema / properties / digest / minimum
      Previous value: --9007199254740991New value: +0
    • changedInput schema / properties / dtype / maximum
      Previous value: -9007199254740991New value: +2
    • changedInput schema / properties / dtype / minimum
      Previous value: --9007199254740991New value: +0
    • changedInput schema / properties / flags / maximum
      Previous value: -9007199254740991New value: +255
    • changedInput schema / properties / flags / minimum
      Previous value: --9007199254740991New value: +0
    • addedInput schema / properties / host / minLength
      Added value: +1
    • changedInput schema / properties / port / description
      Previous value: -"required for SRV: the port the service is found on"New value: +"required for SRV: the port 0-65535 the service is found on"
    • changedInput schema / properties / priority / description
      Previous value: -"required for MX and SRV: preference value, lower is tried first"New value: +"required for MX and SRV: preference value 0-65535, lower is tried first"
    • changedInput schema / properties / priority / maximum
      Previous value: -9007199254740991New value: +65535
    • changedInput schema / properties / priority / minimum
      Previous value: --9007199254740991New value: +0
    • changedInput schema / properties / selector / maximum
      Previous value: -9007199254740991New value: +1
    • changedInput schema / properties / selector / minimum
      Previous value: --9007199254740991New value: +0
    • addedInput schema / properties / tag / anyOf
      Added value: +[
      +  {
      +    "maximum": 65535,
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  {
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / tag / description
      Previous value: -"required for DS (the key tag of the referenced DNSKEY) and for CAA (the property tag, e.g. issue, issuewild or iodef)"New value: +"required for DS as a number (the key tag 0-65535 of the referenced DNSKEY) and for CAA as a string (the property tag, e.g. issue, issuewild or iodef)"
    • removedInput schema / properties / tag / type
      Removed value: -[
      -  "number",
      -  "string"
      -]
    • changedInput schema / properties / usage / maximum
      Previous value: -9007199254740991New value: +3
    • changedInput schema / properties / usage / minimum
      Previous value: --9007199254740991New value: +0
    • changedInput schema / properties / weight / description
      Previous value: -"required for SRV: relative weight among records with the same priority"New value: +"required for SRV: relative weight 0-65535 among records with the same priority"
    • changedInput schema / properties / weight / maximum
      Previous value: -9007199254740991New value: +65535
    • changedInput schema / properties / weight / minimum
      Previous value: --9007199254740991New value: +0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "action": {
      +      "enum": [
      +        "created",
      +        "updated"
      +      ],
      +      "type": "string"
      +    },
      +    "record": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "alg": {
      +          "type": "number"
      +        },
      +        "data": {
      +          "type": "string"
      +        },
      +        "digest": {
      +          "type": "number"
      +        },
      +        "dtype": {
      +          "type": "number"
      +        },
      +        "flags": {
      +          "type": "number"
      +        },
      +        "host": {
      +          "type": "string"
      +        },
      +        "id": {
      +          "type": "number"
      +        },
      +        "port": {
      +          "type": "number"
      +        },
      +        "priority": {
      +          "type": "number"
      +        },
      +        "selector": {
      +          "type": "number"
      +        },
      +        "tag": {
      +          "type": [
      +            "number",
      +            "string"
      +          ]
      +        },
      +        "ttl": {
      +          "type": "number"
      +        },
      +        "type": {
      +          "type": "string"
      +        },
      +        "usage": {
      +          "type": "number"
      +        },
      +        "weight": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "host",
      +        "type",
      +        "data"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "action",
      +    "record"
      +  ],
      +  "type": "object"
      +}
  3. First observedv1.1.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds the merge semantics that matter operationally: omitted optional fields (ttl, priority) keep their stored value on update rather than being reset. It also discloses an atomic failure mode ('fails without changing anything') and the response shape, none of which the annotations convey.

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?

Four tight sentences with no filler, ordered by importance: core semantics first, then update behavior, then the failure mode with alternatives, then the return value. The MX/TXT parenthetical is a useful concrete example rather than padding.

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 mutation tool with an output schema and full annotation coverage, the description supplies the parts structured fields cannot: upsert merge behavior, the multi-record conflict rule, and the routing to siblings. Nothing an agent needs in order to call it safely 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?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning the schema lacks: omitted optional fields preserve their stored values on update, which changes how an agent should pass ttl and priority. It does not, however, discuss the type-specific parameters (usage, selector, dtype, digest, alg, tag, flags), which are only documented in 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 definition of upsert semantics: 'Make sure a host has exactly this record of the given type: updates the existing record for that host and type, or creates one if there is none.' That names the verb (create/update), the resource (DNS record), and the uniqueness key (host + type), which is exactly what separates it from create_dns_record, update_dns_record and patch_dns_record.

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 an explicit when-not: if the host already has several records of that type (MX, TXT), the call fails and you should use patch_dns_record with a record_id or create_dns_record to add another. Both alternatives are named with the condition that selects them, so an agent can route without opening other schemas.

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