Skip to main content
Glama

get_notification_metrics

Read-only

Delivery funnel for ONE notification template over time: sent, delivered, opened, clicked, errors and undeliverable, per provider and channel, in time buckets.

Choosing the window — supply EITHER lookback OR start and end together, NEVER both. Supplying both is rejected. For a relative window like 'the last week', lookback alone is the whole answer: do not also pin start and end. Default is the last 30 days by day. Fine granularities cover shorter windows: HOUR spans at most 7 days and DAY at most 90. How far back a workspace may look also depends on its plan; a request reaching further back is refused with a payment error, which means the plan does not cover that window, NOT that there is no data. A coarser granularity can reach further back than a fine one.

Reading the numbers correctly:

  • The first four counters are NESTED, not separate groups. Every delivered message is also counted in sent, every opened one in delivered, every clicked one in opened. So sent >= delivered >= opened >= clicked always. Report rates (delivered/sent) or the counters themselves. Do NOT add them together — the total is meaningless. And sent minus delivered is NOT a failure count; it is only 'did not reach the delivered stage', for any reason.

  • errors and undeliverable are counted separately and OVERLAP the funnel: a message that failed on one provider and succeeded on a retry appears in both errors and sent. They are not a remainder and do not complete a total.

  • Every counter is a count of distinct MESSAGES, not of events. A message that errored three times counts once in errors.

  • A bucket's data array holds one entry per provider and channel. To get a bucket total, add up the entries in that array — that is the only sum that means anything here. Note that rows for Courier's own built-in email sender are excluded, so these entries can add up to less than the workspace's true volume.

What the buckets mean:

  • A message is counted in the bucket it was ENQUEUED in, not when the event happened. An open today of a message sent last Tuesday is counted in last Tuesday's bucket. So a past bucket can still change: yesterday's opened may be higher when you ask again tomorrow.

  • Results are cached for up to an hour and the pipeline adds its own lag, so a message sent minutes ago is expected NOT to appear yet. Never tell a user a just-sent message is missing; say the data has not caught up.

  • Read the window off the response's start and end, not off what you asked for. The API widens the window to whole buckets and returns the boundaries it actually used.

  • Quiet buckets are returned with an empty data array, so the series has no gaps.

  • An unknown template id returns an all-empty series rather than an error, and messages sent without a template never appear here at all. An empty result is not proof a template is unused — check that the id is right before concluding anything from it.

  • Because of that, a NOT FOUND / 404 error is never about the template id. It means the metrics endpoint itself could not be reached, which is an infrastructure or configuration problem on Courier's side. Say that the metrics service is unreachable and that someone should be told; do NOT tell the user to check or correct their template id, which sends them to fix something that was never wrong.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoWindow end, ISO 8601 with offset. Requires start. Must not be combined with lookback.
startNoInclusive window start, ISO 8601 with offset (2026-04-01T00:00:00Z). Requires end. Must not be combined with lookback.
lookbackNoWindow length counted back from now, as an ISO 8601 duration (P30D, P12W, PT12H). Defaults to P30D. Must not be combined with start/end.
granularityNoBucket size. HOUR covers at most 7 days, DAY at most 90. Defaults to DAY.DAY
notification_idYesThe notification template ID to report on (no commas or whitespace)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, so the description carries the behavioral burden and exceeds it substantially. It discloses nested counter semantics, overlap between errors/undeliverable and the funnel, distinct-message counting, enqueue-time bucketing, caching lag, widening of the window, empty data arrays, and the meaning of 404 errors. This is exemplary transparency.

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?

Although long, the description is carefully structured with clear headings ('Choosing the window', 'Reading the numbers correctly', 'What the buckets mean') and front-loads the most important operational constraints. Every section adds necessary behavioral context rather than padding.

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 fully compensates by explaining the response shape: bucket data arrays per provider/channel, how to compute bucket totals, empty arrays for quiet buckets, and reading start/end from the response. It also covers error behavior for unknown template ids and 404s, leaving no critical gap for correct invocation.

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 coverage is 100%, which sets a baseline of 3, but the description adds significant semantic depth: it explains how lookback relates to start/end, how granularity constrains the window (HOUR at most 7 days, DAY at most 90), plan-based lookback limits, and the warning against combining lookback with start/end. This goes well beyond the schema's field 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 opening sentence states a specific verb and resource: 'Delivery funnel for ONE notification template over time' with concrete counters (sent, delivered, opened, clicked, errors, undeliverable) per provider and channel. This clearly distinguishes it from sibling get_* tools by emphasizing it is scoped to a single template's aggregate delivery metrics.

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 explicit when-to-use guidance for window selection: 'supply EITHER lookback OR start and end together, NEVER both', plus granularity limits and plan-based restrictions. It does not name alternative sibling tools for comparison, but the usage context is unambiguous and actionable.

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.

Resources