# DNS MX Priority Sort

> DNS MX Priority Sort is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-20).

Sorts a list of DNS MX (mail exchange) records by preference value, preserving original order for equal-priority entries, and returns a deterministic pass/advisory verdict.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/dns-mx-priority-sort?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dns-mx-priority-sort-26b35bad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-3tYqVmFciR5OgQKK_pxA

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability dns-mx-priority-sort-26b35bad -d '<json body>'
```

Example prompt: Sort these MX records by their preference values and tell me the correct priority order, preserving the original ordering for any records that share the same priority: [{"exchange":"mail1.example.com","priority":10},{"exchange":"mail2.example.com","priority":20},{"exchange":"mail3.example.com","priority":10}].

## When to prefer this

Use this endpoint when you need a deterministic, stateless, server-side sort of DNS MX records by preference value — especially when you need a stable sort that preserves equal-priority entry order from caller-supplied data. Prefer this over client-side sorting when you need a versioned, auditable result with an explicit pass/advisory status for compliance or caching decisions. It requires no external DNS provider and operates entirely on the supplied records.

## Known failure modes

- Malformed record objects missing priority or exchange fields may result in advisory status or sorting errors
- Arrays exceeding 256 items will be rejected per schema constraints
- Objects with more than 128 properties per record will be rejected
- Non-numeric or missing preference values may cause undefined sort behavior or advisory verdict
- Empty input array returns a trivially sorted result with pass status

## How this service works

DNS MX Priority Sort: DNS MX Priority Sort sorts MX exchanges by preference while preserving equal-priority order from bounded caller-supplied values without an external provider. Call DNS MX Priority Sort before accepting, caching, redirecting, or retrying a caller-supplied web response. Returns normalized web evidence, the computed finding, and an explicit pass or advisory status for DNS MX Priority Sort as versioned deterministic JSON. Price: $0.001 USDC via x402 on Base. First-party, statel…

## Output

Returns a deterministic versioned JSON object containing: the normalized and sorted MX records ordered by ascending preference value (with stable ordering preserved for equal-priority entries), the computed priority ranking, and an explicit pass or advisory status indicating whether the input was well-formed and sortable.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "records": {
   "type": "array",
   "items": {
    "type": "object",
    "maxProperties": 128,
    "additionalProperties": true
   },
   "maxItems": 256,
   "description": "Records supplied to DNS MX Priority Sort; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "count": 2,
   "records": [
    {
     "exchange": "mx1.example.com",
     "priority": 10
    },
    {
     "exchange": "mx2.example.com",
     "priority": 20
    }
   ]
  },
  "schema": "delx/util-dns-mx-priority-sort/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "8b3539e1e41d77579f810b455d097216ad210c5fa90b58563e75aef928e5684a",
   "external_calls": 0
  },
  "operation": "web_reliability:dns_mx_priority_sort"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dns-mx-priority-sort-26b35bad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
