Add a custom domain
cooper_add_domainUse this when the user wants to add a custom domain. Free includes 1. Requires auth. One call returns the SPF, DKIM, DMARC, and MX records to publish, plus a verify TXT. Inputs: domain (required hostname, such as agents.example.com), client_id (optional idempotency key). Calling again with the same domain returns the current status and does not create a second domain. Returns {id, domain, status, status_detail, mail, records, warnings, dns}. status is pending until DNS matches, then verified. Each record has status (valid, missing, or invalid), found, and hint (null, or {code, message, found_at} saying what to change). warnings is empty when none. existing_mail_provider means this hostname already has MX at another provider; suggest a subdomain. Custom domains are included on Starter (15) and Pro (200). Free includes 1. Past that cap is HTTP 402 plan_limit_exceeded. Publish exactly the records returned, with their host, type, value, priority for MX, and ttl. The receiving MX hostname and the DKIM value come from that response. Do not invent them. dns.mode automatic means Cooper wrote the records in a zone it already controls. dns.mode external means you publish them at your DNS host. Keep one SPF TXT with a single include; an existing SPF is merged into it. A DMARC p=reject record is left as published and blocks mail until DKIM for that domain verifies. mail.receiving and mail.sending stay false until the matching records verify. Then POST /api/v1/inboxes with domain creates username@domain. HTTP 402 plan_limit_exceeded with upgrade_url means this plan does not include another custom domain. HTTP 409 domain_exists means another account already registered it. HTTP 409 domain_reserved means the hostname is in a zone Cooper's operator manages. HTTP 400 invalid_domain means the hostname is not usable. Check now with cooper_verify_domain, or subscribe to domain.verified. At 80 percent of a plan limit the response includes notices [{type: limit_warning, resource, used, limit, upgrade_url}].
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": "<domain>"
},
"name": "cooper_add_domain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Hostname to attach, such as agents.example.com | |
| client_id | No | Optional idempotency key. The same key returns the original domain. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Domain id (dom_…). Pass it as domain_id to cooper_verify_domain. | |
| dns | No | {mode}: automatic when Cooper wrote the records, external when you publish them. | |
| No | {receiving, sending, inboxes} flags. Each turns true once its records verify. | ||
| domain | No | Hostname of the custom domain. | |
| status | No | pending until DNS matches, then verified. | |
| notices | No | Usage notices, such as [{type: limit_warning, resource, used, limit, upgrade_url}] at 80 percent of a plan limit. | |
| records | No | DNS records to publish [{host, type, value, priority, ttl, status, found, hint}]. Publish exactly these. | |
| warnings | No | Problems found in existing DNS, such as existing_mail_provider. Empty when none. | |
| created_at | No | ISO-8601 time the object was created. | |
| idempotent | No | True when this result replays an earlier request with the same key instead of acting again. | |
| status_detail | No | Plain-language note on what is still pending. |