Skip to main content
Glama

Get email stats

get_email_stats
Read-onlyIdempotent

Read workspace email delivery counts, rates and time series.

    Without ``from_`` and ``to``, the range is the last seven days.
    Hourly ranges are limited to eight days; all ranges to 92 days.
    Returns ``from``, ``to``, ``bucket``, ``totals``, ``rates`` and ``series``.
    Rates are null when the sent count is zero.
    Open and click counts cover HTML emails only; plain-text emails lower these rates.
    An upstream failure returns an error.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_email_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd of the counting window, with a time zone. Omitted: now.
from_NoStart of the counting window, with a time zone. Omitted: seven days before ``to``.
bucketNoTime span each point in ``series`` counts. Hourly points suit short ranges; daily points suit weeks.day
llm_modelNoThe calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / llm_model / description
      Previous value: -"Model ID of the calling agent. Optional. Recorded for analytics only."New value: +"The calling agent's provider model ID, as shown in the client's model configuration when available. Recorded for analytics."
  2. Changed4 schema fields changed
    • addedOutput schema / $defs
      Added value: +{
      +  "EmailStatsBucket": {
      +    "properties": {
      +      "bounced": {
      +        "default": 0,
      +        "description": "Emails bounced (soft or hard) in the window.",
      +        "title": "Bounced",
      +        "type": "integer"
      +      },
      +      "bounced_hard": {
      +        "default": 0,
      +        "description": "Emails hard-bounced in the window. Subset of bounced.",
      +        "title": "Bounced Hard",
      +        "type": "integer"
      +      },
      +      "bucket_start": {
      +        "description": "Start of this bucket, ISO 8601 timestamp.",
      +        "format": "date-time",
      +        "title": "Bucket Start",
      +        "type": "string"
      +      },
      +      "clicked": {
      +        "default": 0,
      +        "description": "Total click events in the window, including repeat clicks by the same recipient. HTML emails only; plain-text-only emails are never tracked for clicks.",
      +        "title": "Clicked",
      +        "type": "integer"
      +      },
      +      "complained": {
      +        "default": 0,
      +        "description": "Emails that received a spam complaint in the window.",
      +        "title": "Complained",
      +        "type": "integer"
      +      },
      +      "delivered": {
      +        "default": 0,
      +        "description": "Emails confirmed delivered in the window.",
      +        "title": "Delivered",
      +        "type": "integer"
      +      },
      +      "delivery_delayed": {
      +        "default": 0,
      +        "description": "Emails with a delivery-delayed event in the window.",
      +        "title": "Delivery Delayed",
      +        "type": "integer"
      +      },
      +      "opened": {
      +        "default": 0,
      +        "description": "Total open events in the window, including repeat opens by the same recipient. HTML emails only; plain-text-only emails are never tracked for opens.",
      +        "title": "Opened",
      +        "type": "integer"
      +      },
      +      "rejected": {
      +        "default": 0,
      +        "description": "Emails rejected by the provider before sending, in the window.",
      +        "title": "Rejected",
      +        "type": "integer"
      +      },
      +      "sent": {
      +        "default": 0,
      +        "description": "Emails sent in the window.",
      +        "title": "Sent",
      +        "type": "integer"
      +      },
      +      "unique_clicked": {
      +        "default": 0,
      +        "description": "Distinct emails clicked at least once in the window (HTML emails only).",
      +        "title": "Unique Clicked",
      +        "type": "integer"
      +      },
      +      "unique_opened": {
      +        "default": 0,
      +        "description": "Distinct emails opened at least once in the window (HTML emails only).",
      +        "title": "Unique Opened",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "sent",
      +      "delivered",
      +      "delivery_delayed",
      +      "bounced",
      +      "bounced_hard",
      +      "complained",
      +      "rejected",
      +      "opened",
      +      "clicked",
      +      "unique_opened",
      +      "unique_clicked",
      +      "bucket_start"
      +    ],
      +    "title": "EmailStatsBucket",
      +    "type": "object"
      +  },
      +  "EmailStatsCounts": {
      +    "properties": {
      +      "bounced": {
      +        "default": 0,
      +        "description": "Emails bounced (soft or hard) in the window.",
      +        "title": "Bounced",
      +        "type": "integer"
      +      },
      +      "bounced_hard": {
      +        "default": 0,
      +        "description": "Emails hard-bounced in the window. Subset of bounced.",
      +        "title": "Bounced Hard",
      +        "type": "integer"
      +      },
      +      "clicked": {
      +        "default": 0,
      +        "description": "Total click events in the window, including repeat clicks by the same recipient. HTML emails only; plain-text-only emails are never tracked for clicks.",
      +        "title": "Clicked",
      +        "type": "integer"
      +      },
      +      "complained": {
      +        "default": 0,
      +        "description": "Emails that received a spam complaint in the window.",
      +        "title": "Complained",
      +        "type": "integer"
      +      },
      +      "delivered": {
      +        "default": 0,
      +        "description": "Emails confirmed delivered in the window.",
      +        "title": "Delivered",
      +        "type": "integer"
      +      },
      +      "delivery_delayed": {
      +        "default": 0,
      +        "description": "Emails with a delivery-delayed event in the window.",
      +        "title": "Delivery Delayed",
      +        "type": "integer"
      +      },
      +      "opened": {
      +        "default": 0,
      +        "description": "Total open events in the window, including repeat opens by the same recipient. HTML emails only; plain-text-only emails are never tracked for opens.",
      +        "title": "Opened",
      +        "type": "integer"
      +      },
      +      "rejected": {
      +        "default": 0,
      +        "description": "Emails rejected by the provider before sending, in the window.",
      +        "title": "Rejected",
      +        "type": "integer"
      +      },
      +      "sent": {
      +        "default": 0,
      +        "description": "Emails sent in the window.",
      +        "title": "Sent",
      +        "type": "integer"
      +      },
      +      "unique_clicked": {
      +        "default": 0,
      +        "description": "Distinct emails clicked at least once in the window (HTML emails only).",
      +        "title": "Unique Clicked",
      +        "type": "integer"
      +      },
      +      "unique_opened": {
      +        "default": 0,
      +        "description": "Distinct emails opened at least once in the window (HTML emails only).",
      +        "title": "Unique Opened",
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "sent",
      +      "delivered",
      +      "delivery_delayed",
      +      "bounced",
      +      "bounced_hard",
      +      "complained",
      +      "rejected",
      +      "opened",
      +      "clicked",
      +      "unique_opened",
      +      "unique_clicked"
      +    ],
      +    "title": "EmailStatsCounts",
      +    "type": "object"
      +  },
      +  "EmailStatsRates": {
      +    "description": "All None when sent == 0 in the window.",
      +    "properties": {
      +      "bounce": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "bounced_hard / sent for the window. Null when sent == 0.",
      +        "title": "Bounce"
      +      },
      +      "click": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "unique_clicked / sent for the window. Null when sent == 0. Only HTML emails can be click-tracked, so plain-text sends lower this rate.",
      +        "title": "Click"
      +      },
      +      "complaint": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "complained / sent for the window. Null when sent == 0.",
      +        "title": "Complaint"
      +      },
      +      "delivery": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "delivered / sent for the window. Null when sent == 0.",
      +        "title": "Delivery"
      +      },
      +      "open": {
      +        "anyOf": [
      +          {
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "unique_opened / sent for the window. Null when sent == 0. Only HTML emails can be opened-tracked, so plain-text sends lower this rate.",
      +        "title": "Open"
      +      }
      +    },
      +    "required": [
      +      "delivery",
      +      "bounce",
      +      "complaint",
      +      "open",
      +      "click"
      +    ],
      +    "title": "EmailStatsRates",
      +    "type": "object"
      +  }
      +}
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "bucket": {
      +        "description": "Time-bucket size used for the series.",
      +        "enum": [
      +          "hour",
      +          "day"
      +        ],
      +        "title": "Bucket",
      +        "type": "string"
      +      },
      +      "from": {
      +        "description": "Start of the queried window, ISO 8601 timestamp (inclusive).",
      +        "format": "date-time",
      +        "title": "From",
      +        "type": "string"
      +      },
      +      "rates": {
      +        "$ref": "#/$defs/EmailStatsRates",
      +        "description": "Derived rates (delivery, bounce, complaint, open, click) for the whole window. Each individual rate is null when sent == 0."
      +      },
      +      "series": {
      +        "description": "Per-bucket event counts across the window, in chronological order.",
      +        "items": {
      +          "$ref": "#/$defs/EmailStatsBucket"
      +        },
      +        "title": "Series",
      +        "type": "array"
      +      },
      +      "to": {
      +        "description": "End of the queried window, ISO 8601 timestamp (exclusive).",
      +        "format": "date-time",
      +        "title": "To",
      +        "type": "string"
      +      },
      +      "totals": {
      +        "$ref": "#/$defs/EmailStatsCounts",
      +        "description": "Event counts summed across the whole window."
      +      }
      +    },
      +    "required": [
      +      "from",
      +      "to",
      +      "bucket",
      +      "totals",
      +      "rates",
      +      "series"
      +    ],
      +    "title": "EmailStatsResponse",
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "error": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / title
      Removed value: -"get_email_stats_toolDictOutput"
  3. Changed1 schema field changed
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Model ID of the calling agent. Optional. Recorded for analytics only.",
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / bucket / description
      Previous value: -"Length of each step in the time series."New value: +"Time span each point in ``series`` counts. Hourly points suit short ranges; daily points suit weeks."
  5. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare this a safe, idempotent read, yet the description goes further by disclosing default range behavior, range ceilings, null rates when sent count is zero, the HTML-only scope of open/click counts, and upstream-failure error behavior. These are exactly the operational traits an agent cannot infer from the annotation set.

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 purpose is front-loaded and the constraints follow in short, scannable lines with no filler prose. Minor redundancy exists because return fields are enumerated despite an output schema being present, and the final error line is close to boilerplate.

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 four optional parameters and an existing output schema, the description supplies everything needed to call correctly: defaults, range limits, zero-count rate semantics, and error behavior. Nothing an agent requires is missing.

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 a baseline of 3 applies, but the description adds real meaning: it establishes that omitting from_ and to yields a seven-day window and that hourly buckets are constrained to eight days. That couples bucket choice and date range in a way the schema alone does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Read workspace email delivery counts, rates and time series,' which separates aggregate stats from per-message siblings like get_email or get_email_events. It does not name an alternative explicitly, so it stops short of the top mark.

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

Usage Guidelines3/5

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

The default window (last seven days) and the hard limits (8 days hourly, 92 days overall) effectively tell an agent when a given request is valid. However, there is no explicit guidance on when to choose this tool over the other email-related siblings, so usage is implied rather than stated.

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.