Skip to main content
Glama

Choose a website's primary custom domain

airapps_site_set_primary_domain

Makes one bound hostname the primary: every other custom domain of the website answers a permanent redirect (308) to it, keeping the path and query. hostname: null clears the primary so every domain serves the site directly. The generated address never redirects. The first domain bound becomes primary automatically.

POST /api/v1/airapps/{nodeId}/site/domains/primary

For multi-space accounts, call auth_verify, ask the user which space to use, and pass targetSpaceId. An AirApp's website: after its files change, deploy the members-only preview, then go live to put that same version on the public address. Changes to records need no redeploy. Change the primary domain only when the user asks: every other custom domain then redirects to it. hostname null stops the redirects. A PRECONDITION_FAILED saying primary domains are not supported means this deployment cannot redirect yet.

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": {
      "nodeId": "<nodeId>",
      "hostname": "<hostname>"
    },
    "name": "airapps_site_set_primary_domain"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodeIdYes
hostnameYes
targetSpaceIdNoBusabase space id. Call auth_verify first and ask the user which space to use when more than one is returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only say readOnly=false, destructive=false, openWorld=false; the description goes well beyond by disclosing that all other custom domains start issuing permanent 308 redirects, that the generated address never redirects, that the first bound domain becomes primary automatically, and that PRECONDITION_FAILED means redirects are unsupported. It does not cover propagation timing or what the response contains, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first paragraph is front-loaded and efficient, but the trailing workflow paragraph about deploying previews before going live is largely tangential to setting a primary domain, and the redirect consequence plus the null behavior are restated twice. Roughly a third of the text could be cut without losing decision-relevant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter mutation with no output schema, most of what an agent needs is present: side effects, the null escape hatch, space selection, and one error code. Gaps remain around required permissions, what the tool returns on success, and what nodeId refers to (site vs node).

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 only 33%, with just targetSpaceId documented inline, so the description must carry hostname and nodeId. It does add meaning for hostname — it must already be bound, and null is a distinct clear-primary mode rather than an error — but nodeId is never explained and no example hostname format is given beyond the regex.

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 concrete verb and resource — making one bound hostname the site's primary domain — and immediately specifies the observable effect: every other custom domain answers a 308 redirect keeping path and query. That distinguishes it clearly from the bind/unbind siblings, which add or remove domains rather than reorder which one is primary.

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 real when-to-use guidance ('Change the primary domain only when the user asks') and the inverse operation ('hostname: null clears the primary so every domain serves the site directly'), plus the multi-space routine of calling auth_verify and asking the user. It stops short of naming the sibling alternatives (e.g. bind_domain for adding, unbind_domain for removing) that an agent might confuse with this tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.