Skip to main content
Glama

IntoDNS.ai DNS & Email Security Scanner

generate_spf

Read-onlyIdempotent

Build an SPF (Sender Policy Framework) record — the DNS TXT record that lists which servers may send mail for a domain. Pass the senders as mechanisms: include for a provider's own SPF (Google Workspace is _spf.google.com, Microsoft 365 is spf.protection.outlook.com, SendGrid is sendgrid.net), ip4/ip6 for your own servers, plus useMx/useA to authorise the domain's own MX or A records. The policy decides what receivers do with mail from anywhere else: 'fail' (-all, the production choice), 'softfail' (~all, for testing), 'neutral', or 'pass' (+all, which authorises the entire internet and should never be published). SPF is limited to ten DNS-triggering terms during recursive evaluation. This pure builder counts direct mechanisms; include and redirect targets can add nested lookups, so validate the published record with check_spf before treating the count as final. Returns the record, direct lookup count, whether that direct count or the 255-character limit is exceeded, plain-language warnings, and the DNS entry to publish. Use check_spf to resolve and validate a live record, and flatten_spf only when an existing record is over the limit. Invalid input (an address that is not IPv4/IPv6 for ip4/ip6, a value that is not a domain name, or a second redirect=) is refused with an error instead of a record. Nothing is looked up or stored — this is computation only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
useANoAuthorise the domain's own A/AAAA records. Costs one DNS lookup.
useMxNoAuthorise the domain's MX hosts. Costs one DNS lookup.
policyNoWhat receivers do with everything else: fail (-all) for production, softfail (~all) while testing. Defaults to fail.
mechanismsNoSenders to authorise, in the order they should appear in the record

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already indicate readOnly, idempotent, non-destructive, and open-world behavior. The description goes well beyond these by stating that nothing is looked up or stored, that invalid inputs are refused with an error, that SPF has a ten-term evaluation limit, and that nested lookups can alter the count. This is rich behavioral context with no contradiction.

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?

The description is long but every sentence carries useful information: purpose, parameter guidance, limits, alternatives, error behavior, and side-effect guarantees. It is front-loaded with the core purpose and then layers details logically. A slight deduction because it is dense enough that an agent may need to parse carefully, but there is no fluff.

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?

With no output schema, the description takes on the burden of explaining return values, and it does: 'Returns the record, direct lookup count, whether that direct count or the 255-character limit is exceeded, plain-language warnings, and the DNS entry to publish.' It also covers error cases, parameter meaning, and sibling tool routing. Nothing critical is missing for correct invocation.

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 100%, so the baseline is 3. The description adds meaningful domain knowledge beyond the schema: concrete include values like '_spf.google.com' and 'spf.protection.outlook.com', the policy meanings of '-all' and '+all', and the warning that '+all' should never be published. This justifies a score above baseline.

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 description opens with a specific verb and resource: 'Build an SPF (Sender Policy Framework) record — the DNS TXT record that lists which servers may send mail for a domain.' It clearly differentiates from siblings like check_spf and flatten_spf by naming them explicitly. This is far more than a tautology.

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?

It gives explicit usage guidance: 'Use check_spf to resolve and validate a live record, and flatten_spf only when an existing record is over the limit.' It also clarifies that this tool is a pure builder and that validation with check_spf is recommended. The when/when-not distinction is unmistakable.

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.