Skip to main content
Glama

Discount Code Performance

get_discount_code_performance
Read-onlyIdempotent

Get per-discount-code margin metrics: uses, revenue, discount cost, COGS, allocated ad spend, gross profit, and margin percent, ranked by any column. Pre-aggregated rolling timeframes provide the fastest results, while an explicit start_date/end_date produces a custom range computed live.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number, 1-based (default 1).
sort_byNoSort field, default 'grossProfit'.
end_dateNoCustom range end (YYYY-MM-DD, tenant timezone). Requires start_date.
page_sizeNoRows per page, 1 to 100 (default 25).
timeframeNoPre-aggregated rolling window: 'today', '7d', '30d' (default), '90d', or '1y'. Ignored when start_date and end_date are both provided.
sort_orderNoSort direction, default 'desc'.
start_dateNoCustom range start (YYYY-MM-DD, tenant timezone). Requires end_date. Overrides timeframe.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
_metaNo
codesNo
periodNo
sourceNoWhether the figures came from the pre-computed cache or were calculated live for this request.
summaryNo
_messageNo
_truncatedNo
paginationNo
_tenant_contextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds useful behavioral context: rolling timeframes are pre-aggregated and fastest, while explicit dates are computed live. No contradiction with annotations exists.

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?

Two sentences with no filler. The core metrics and the key parameter tradeoff are front-loaded, and every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema and rich annotations, the description covers the essential purpose, returned metrics, and the main parameter behavior. It is complete enough for correct invocation, though it does not discuss pagination or sort defaults, which the schema already documents.

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 the baseline is 3, but the description adds meaningful cross-parameter semantics by explaining the performance difference between timeframe and explicit start_date/end_date. This goes beyond individual schema property descriptions and helps the agent choose the right parameter combination.

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 uses a specific verb and resource: 'Get per-discount-code margin metrics', then enumerates the exact fields returned. This level of detail clearly distinguishes it from sibling tools like get_ad_performance or get_pnl_summary.

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?

It gives clear context for selecting between pre-aggregated rolling timeframes and a custom live-computed date range, including the performance tradeoff. It does not explicitly name sibling alternatives or exclusion criteria, but the usage context is practical and clear.

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