Skip to main content
Glama

Hail Communication for AI

Route an email address to an agent

route_email_domain
Idempotent

Choose which agent answers mail to an address, and who it answers.

    Setting ``email_agent_id`` together with ``clear_agent=True`` is an error.
    With ``email_agent_scope="anyone"``, a stranger can make the agent use its
    allowed tools. Mail without a passing DMARC result gets no reply.
    A custom domain must be verified with inbound and sending on.
    A field left out keeps its value, except that a new agent starts at ``"members"``.

    Returns the updated ``EmailDomainResponse`` as a dict, or
    ``{"error": "<message>"}``.
    

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>"
    },
    "name": "route_email_domain"
  }
}

Input Schema

NameRequiredDescriptionDefault
domain_idYesEmail identity ID, the ``id`` from ``list_email_domains``.
llm_modelNoModel ID of the calling agent. Optional. Recorded for analytics only.
clear_agentNo``true`` stops the agent replying to this address's mail.
email_agent_idNoAgent that replies to inbound mail, from ``list_agents`` or ``create_agent``.
email_agent_scopeNoWho the agent answers: ``members`` (verified members of the workspace whose mail passes DMARC) or ``anyone`` (every sender whose mail passes DMARC and the spam checks). Omitted: the current scope stays; a newly set agent starts at ``members``.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Model ID of the calling agent. Optional. Recorded for analytics only.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / email_agent_scope / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "members",
      +      "anyone"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / email_agent_scope / description
      Previous value: -"Who the agent answers: ``members`` (verified members of the workspace whose mail passes DMARC) or ``anyone`` (every sender whose mail passes DMARC and the spam checks)."New value: +"Who the agent answers: ``members`` (verified members of the workspace whose mail passes DMARC) or ``anyone`` (every sender whose mail passes DMARC and the spam checks). Omitted: the current scope stays; a newly set agent starts at ``members``."
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare a non-destructive, idempotent, closed-world mutation, and the description correctly adds context beyond them: the DMARC and verified-domain preconditions, the error on combining email_agent_id with clear_agent=True, the partial-update rule (omitted fields retain values), and the return of EmailDomainResponse or an error dict. The only gap is permission/authorization requirements for changing routing.

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

Conciseness4/5

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

Purpose is front-loaded, followed by preconditions, mutation semantics, and return shape, with no filler. The reStructuredText backticks and stray indentation are noise, and 'who it answers' in the first line is slightly elliptical, but the content density is appropriate.

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 five-parameter mutation on a verified email domain, the description covers preconditions, error combination, default-scope behavior on assignment, partial-update semantics, and return shape (even though an output schema exists). Nothing an agent needs in order to call this correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter is already documented, including the scope enum values and the 'members' default for a newly set agent. The description mostly restates that contract; its only genuine addition is that email_agent_id combined with clear_agent=True is an error, which keeps this at the baseline rather than above it.

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 opening sentence states a specific verb-and-resource pair: choosing which agent answers mail for an email address, plus which senders it answers. Combined with the domain_id parameter, it is clearly the email-domain analog of route_number and is distinct from list_email_domains or update_agent, so an agent can select it without opening a sibling schema.

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?

The description supplies concrete conditions for use: the domain must be a verified custom domain with inbound and sending enabled, mail must pass DMARC to get a reply, and setting email_agent_id together with clear_agent=True is rejected. It does not explicitly point at an alternative tool (e.g., route_number for phone numbers), so it stops just short of full routing guidance.

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.

Resources