update_dns
Replace all DNS records for domains with new configurations including A, AAAA, CNAME, and TXT records. Confirm changes to update DNS settings.
Instructions
Replace the full DNS records set.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | ||
| confirm | Yes |
Implementation Reference
- src/requestrepo_mcp/server.py:224-232 (handler)The RequestrepoMCPService.update_dns method implements the core business logic for the update_dns tool. It validates confirmation, converts input records to DnsRecord models, calls the client to update DNS, and returns the updated records count and details.
def update_dns(self, *, records: list[DnsRecordInput], confirm: bool) -> dict[str, Any]: self._require_confirm(confirm, "update_dns") dns_records = [DnsRecord(type=record.type, domain=record.domain, value=record.value) for record in records] updated = self._client().update_dns(dns_records) return { "updated": updated, "count": len(dns_records), "records": [serialize_dns_record(record) for record in dns_records], } - src/requestrepo_mcp/server.py:441-444 (registration)The MCP tool registration for update_dns. This @mcp.tool() decorated function exposes the update_dns operation to the MCP server, accepting a list of DnsRecordInput and a confirm boolean parameter.
@mcp.tool() def update_dns(records: list[DnsRecordInput], confirm: bool) -> dict[str, Any]: """Replace the full DNS records set.""" return resolved_service.update_dns(records=records, confirm=confirm) - src/requestrepo_mcp/schemas.py:10-18 (schema)Schema definitions for update_dns tool inputs. DnsRecordType defines allowed DNS record types (A, AAAA, CNAME, TXT) and DnsRecordInput is the Pydantic BaseModel used for each DNS record in the update_dns tool.
DnsRecordType = Literal["A", "AAAA", "CNAME", "TXT"] class DnsRecordInput(BaseModel): """DNS record payload for update_dns.""" type: DnsRecordType domain: str value: str - Helper function serialize_dns_record that converts DnsRecord objects to dictionaries for API responses. Used by the update_dns handler to format output records.
def serialize_dns_record(record: DnsRecord) -> dict[str, str]: return { "type": record.type, "domain": record.domain, "value": record.value, }