Skip to main content
Glama

generate_spf

Read-onlyIdempotent

Builds an SPF DNS record that authorizes specified senders and sets the policy for unauthorized mail.

Instructions

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). The reason to call this rather than write the string yourself: SPF is limited to ten DNS lookups when it is evaluated, and exceeding that is a PermError which receivers treat as the domain having no SPF at all. include, a, mx, exists and redirect each cost a lookup; ip4 and ip6 are free. Returns the record, the lookup count, whether either the lookup or 255-character limit is exceeded, warnings in plain language, and the DNS entry to publish. Use check_spf instead to read and validate the record a domain already publishes, and flatten_spf when an existing record is over the lookup limit and has to be reduced; use this to build a new record from scratch. 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
Behavior5/5

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

Beyond annotations (readOnlyHint, idempotentHint), the description states 'Nothing is looked up or stored — this is computation only,' which is a strong behavioral disclosure. It also details the output: 'Returns the record, the lookup count, whether either the lookup or 255-character limit is exceeded, warnings in plain language, and the DNS entry to publish.' This fully informs the agent of behavior and side effects.

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

Conciseness5/5

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

The description is information-dense but not verbose. It starts with a clear purpose, then explains parameters with examples, rationale for using the tool (lookup limits), alternatives, and ends with side-effect note. Every sentence adds value; no fluff. It is well-structured and front-loaded.

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?

The description covers all necessary context for a complex tool: what it does, how to use it, why it's helpful (lookup limits), return values, alternatives, and that it's computation-only. Even without an output schema, it describes outputs clearly. It also addresses common pitfalls (pass policy, lookup limits) making it complete.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds domain-specific meaning: concrete examples for include values (Google Workspace, Microsoft 365, SendGrid), explanation of policy values with their SPF syntax (-all, ~all), and the lookup cost of each mechanism type (not in schema). It also explains the semantics of useMx/useA in practical terms. This goes well beyond the 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 begins with 'Build an SPF (Sender Policy Framework) record' which specifies the verb and resource clearly. It then distinguishes this tool from siblings by explicitly stating 'Use check_spf instead to read and validate... and flatten_spf when... use this to build a new record from scratch.' This clearly establishes unique purpose.

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?

Provides explicit guidance on when to use this tool vs alternatives: 'The reason to call this rather than write the string yourself' explains the value proposition, and it names check_spf and flatten_spf as alternatives with distinct use cases. It also clarifies when not to use it (existing records).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RoscoNL/intodns-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server