Skip to main content
Glama
shigechika

gwsadm-mcp

by shigechika

dmarc_rua_summary

Summarize DMARC aggregate reports to show pass/fail per domain and identify top IPs that a p=reject policy would block.

Instructions

Summarize DMARC aggregate (RUA) reports: pass/fail per domain, top reject-candidate IPs.

Impersonates the domain's configured dmarc_rua_mailbox (a real user -- domain-wide delegation cannot act as a group or alias; config default postmaster@<domain>), searches it for mail addressed to dmarc_rua_recipient (the rua=mailto: address published in DNS, e.g. the postmaster+rua@ plus-subaddress; default: same as the mailbox), reads the aggregate reports those messages carry, and answers "how much of this domain's mail volume is passing DMARC, and if we moved the policy to p=reject, what would actually get blocked?"

A record counts as PASS when either its aligned DKIM or SPF check reads "pass" (DMARC's own OR semantics) — NOT when both do. A record counts as a reject candidate when it is already quarantined or rejected (a tenant already running p=quarantine/p=reject enforces this today), or when BOTH checks fail with disposition="none" (what a stricter policy would newly start blocking); everything else is a pass. This distinction matters a lot in practice: a large share of legitimate mail (mailing-list forwards, some relays) passes DMARC via SPF alignment alone with DKIM unaligned, so counting on DKIM alone overstates the failure rate severalfold.

reject_candidate_ips (the top top per domain by volume) is where to actually look before flipping a policy to p=reject: a header_from that names a SUBDOMAIN of the audited domain is governed by that subdomain's own sp= policy, not the parent's p=, so it is not necessarily what a p=reject change on the parent would affect.

Requires the gmail.readonly DWD scope — the same one gmail_message_trace needs, granted PER SERVICE ACCOUNT CLIENT ID in the Admin console (Security > API controls > Domain-wide delegation), separately from the admin.directory.* / admin.reports.* scopes the rest of this server uses.

Read-only: only messages().list/messages().get/ attachments().get against the one configured mailbox are issued — see DomainClient.fetch_dmarc_rua_records.

Args: hours: Lookback window. Default 72 (3 days): RUA reports typically arrive roughly daily per sending source, so a single day's window risks missing infrequent senders entirely. domain: Configured [domain.*] section to report on. Default: all configured domains. mailbox: Override the configured dmarc_rua_mailbox (the user to impersonate) for every selected domain. Set this only for an ad-hoc check against a different inbox than the one in config; unless recipient is also given, that inbox's own address is searched. Also re-enables a domain configured with dmarc_rua_mailbox = none for the duration of the call. Validated as an email-shaped address (rejected otherwise). recipient: Override the address searched for (to:) for every selected domain -- the rua=mailto: value in DNS when it is not the mailbox itself. Validated as an email-shaped address (rejected otherwise) before use, since it is interpolated into a Gmail search query. max_pages: Gmail messages().list pages (100 messages each) to walk per domain. capped=true in the result means more pages existed — a capped fetch UNDER-counts real report volume, not just a lower bound on some other total, since every matching message must be walked (there is no server-side aggregate to fall back on). top: How many reject-candidate source IPs to return per domain (highest volume first). The per-domain pass/quarantined/ rejected/undisposed_fail totals themselves are never truncated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
hoursNo
domainNo
mailboxNo
max_pagesNo
recipientNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.17.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and handles it impressively. It discloses impersonation behavior, the exact read-only Gmail API calls used, the count semantics for PASS vs reject candidates, the subdomain sp= caveat, and the fact that capped fetches under-count real volume. This is far more behavioral detail than annotations alone would typically provide.

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 long but densely packed with information that earns its place: semantics, real-world caveats, scope prerequisites, and parameter explanations are all relevant. It is front-loaded with the main summary and then structures the rest with clear 'Args' entries, making the length navigable rather than bloated.

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?

Given the tool's complexity, absence of annotations, and absence of an output schema, the description is remarkably complete. It explains the data source, the pass/fail decision rule, the reject-candidate definition, the subdomain edge case, the permissions requirement, and the meaning of truncated results. An agent has enough information to invoke it safely and interpret the outcome correctly.

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?

Schema description coverage is 0%, so the description must compensate for every parameter. It does: hours, domain, mailbox, recipient, max_pages, and top each receive meaningful context beyond their raw schema types, including defaults, validation behavior, and result-affecting caveats. This fully compensates for the empty schema descriptions.

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-plus-resource statement: 'Summarize DMARC aggregate (RUA) reports: pass/fail per domain, top reject-candidate IPs.' This clearly identifies both the action and the subject, and the detail about policy-rejection impact further distinguishes it from sibling tools like gmail_message_trace.

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 gives clear context for when the tool is appropriate—auditing DMARC pass/fail and estimating the effect of moving to p=reject—and even compares the required scope to that of gmail_message_trace. It does not explicitly list alternative tools to use instead, but the intended use case is unambiguous and well-bounded.

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