Skip to main content
Glama

Flatten SPF record

flatten_spf
Read-onlyIdempotent

Read-only SPF flattening for a domain. Resolves the full include/a/mx/redirect graph to literal ip4/ip6 addresses and returns a single flattened SPF record that fits under the RFC-7208 10-lookup limit, plus lookup counts before/after, IP…

Instructions

Read-only SPF flattening for a domain. Resolves the full include/a/mx/redirect graph to literal ip4/ip6 addresses and returns a single flattened SPF record that fits under the RFC-7208 10-lookup limit, plus lookup counts before/after, IP count, record length, whether it must be split across multiple records, and a maintenance warning. Use when a domain hits 'too many DNS lookups' (PermError) and removing unused includes is not enough; run check_spf first to see the lookup graph and whether flattening is actually needed. Flattened records are high-maintenance — they break when a provider rotates IPs — so treat the output as a last resort to re-verify periodically. No auth, no side effects.

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": "flatten_spf"
  }
}

Input Schema

NameRequiredDescriptionDefault
domainYesDNS name, e.g. example.com, _spf.google.com or _dmarc.example.com (no URL, path, or port)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.11.1
    • changedInput schema / properties / domain / description
      Previous value: -"Domain name only, e.g. example.com (no URL, path, or port)"New value: +"DNS name, e.g. example.com, _spf.google.com or _dmarc.example.com (no URL, path, or port)"
  2. Addedv1.10.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description goes beyond them by disclosing what comes back (lookup counts before/after, IP count, record length, split requirement, maintenance warning) and a real durability caveat — flattened records break when a provider rotates IPs. Minor redundancy in restating 'no auth, no side effects' 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.

Conciseness4/5

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

Front-loaded with the core action, then progressively adds output contents, usage trigger, and the maintenance caveat. The long enumeration of return fields in one sentence is dense but each item carries real information; nothing is filler.

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?

No output schema exists, so the description must carry return-value burden and does: it lists the fields returned and their meaning. With the single parameter fully documented in schema and annotations covering safety, an agent has everything needed to decide and call correctly.

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?

There is a single parameter with 100% schema description coverage, so the schema already defines the accepted domain format and constraints. The description adds no additional semantics about the domain argument (e.g., whether the apex vs. an SPF subdomain should be passed), so baseline 3 applies.

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 specific verb and resource ('Read-only SPF flattening for a domain') and then spells out the mechanism: resolving the include/a/mx/redirect graph into literal ip4/ip6 addresses. It is clearly separable from siblings like check_spf (diagnostic) and generate_spf (authoring) without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when: a domain hits 'too many DNS lookups' (PermError) and removing unused includes is not enough. Explicit prerequisite/alternative: run check_spf first to see the lookup graph and whether flattening is even needed. Explicit caution: treat output as a last resort. Nothing is left to inference.

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