Skip to main content
Glama

Email Engagement Report

Build an email engagement report

engagement_report
Read-onlyIdempotent

Use this when the user pastes an email event export (Customer.io reporting webhook, SendGrid or Mailgun events) and wants a per-recipient engagement report, a CSV or the events with no recipient. Input tips: send the raw export text itself as events, never a file name or link; the events field lists the shapes read. Add recipients_csv or campaigns_csv only when the user gives them. Rules default to: dedup on, a 14 day window, machine opens as impressions only, bounce clears delivered. Set a rule only when the user names a different window or rule. Returns: a per-send summary, up to 500 recipient rows (csv holds every row), up to 100 exceptions, parse_errors and the rules used. A file that mixes platforms is read event by event. Only for the user's own sends: it reads event types, times and ids, and reads or returns no IP address, user agent, device or location. Next step: when events_kept is 0 or parse_errors is not empty, show the errors and ask for the raw export. Not for: sending mail or calling a mail platform API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rulesNo
eventsYesThe pasted export text itself, not a file name or link, such as {"event_id":"e1","metric":"sent","timestamp":1789480800,"data":{"identifiers":{"id":"R-1"}}}. NDJSON (one event per line) or a JSON array. Read shapes: Customer.io (event_id, metric, timestamp, data.identifiers.id or email, data.delivery_id); SendGrid (flat email, event, timestamp, sg_event_id, sg_message_id); Mailgun (event, id, recipient, timestamp, tags, flat or inside "event-data"). Timestamps are unix seconds; milliseconds are converted. At most 20,000 events and 1,500,000 characters.
campaigns_csvNoOptional CSV text with a header row: deployment_key,deployment_code,campaign_name,client,deploy_date. deployment_key must equal the send key the report gives each send, such as newsletter:12, campaign:5:action:7, broadcast:3:action:9, transactional:4, sendgrid:<template id> or mailgun:<tag>; run the report once to read the keys from summary.
recipients_csvNoOptional CSV text with a header row, then one row per recipient: recipient_id,email,external_id (external_id may be empty). Example: recipient_id,email,external_id\nR-1,ada@example.com,CRM-1001. Events join by recipient_id, then delivery id, then email. Without it every send is a row and nothing is an exception.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
csvYesEvery recipient row as CSV with a header row.
joinNoHow events matched recipients_csv.
rulesNoThe rules this report used, defaults filled in.
noticeYesPrivacy note: nothing is stored.
effectsNoHow many events each rule changed.
summaryYesOne row per send. Sum its recipients for the full row count.
platformYesPlatform read from the first event; email when it is not known, none when no email event was found.
events_inYesEmail events read from the export.
exceptionsYesEvents with no recipient match, at most 100. Empty without recipients_csv.
recipientsYesPer-recipient rows, at most 500; csv holds every row.
events_keptYesEvents left after removing repeated event ids.
parse_errorsNoLines or values that are not valid JSON, at most 20. Show them and ask for the raw export when events_kept is 0.
duplicates_removedNoEvents dropped because their event id was already seen.

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 cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial context beyond them: default rule set (dedup on, 14-day window, machine opens as impressions only, bounce clears delivered), the privacy guarantee that no IP/user agent/device/location is read or returned, mixed-platform files read event by event, and the 500-row/100-exception output caps.

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 trigger and tightly structured into input tips, rules defaults, returns, next step, and exclusions. It is dense and somewhat long, but nearly every clause carries operational information; only the restated defaults border on redundancy with the schema.

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 4-parameter read/compute tool with a nested rules object, optional CSVs, and an output schema, the description leaves nothing essential unstated: it covers input format, defaults, privacy scope, outputs (though the output schema already carries return values), and the failure-recovery path.

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 description coverage is 75% and the schema already documents the rules sub-object defaults individually. The description still adds meaningful semantics: the input tip that events must be the raw export text, when to supply recipients_csv/campaigns_csv, and a consolidated statement of the four most consequential rule defaults. It does not add syntax or format detail beyond the schema, so it does not reach 5.

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+resource: builds a per-recipient email engagement report (summary, CSV, or unmatched events) from a pasted email event export. It explicitly names the platforms it parses (Customer.io, SendGrid, Mailgun) and closes with 'Not for: sending mail or calling a mail platform API,' so an agent can tell it apart from the feedback siblings at a glance.

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?

Gives an explicit trigger ('when the user pastes an email event export'), explicit input constraints (send the raw text, never a file name or link), explicit optional-input conditions ('Add recipients_csv or campaigns_csv only when the user gives them'), a scope restriction ('Only for the user's own sends'), and an explicit next-step branch when events_kept is 0 or parse_errors is non-empty.

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.