Skip to main content
Glama

Top products

get_top_products
Read-onlyIdempotent

The products that earned the most in the current period (ten unless limit asks for up to 50), largest net sales first, with netSales (after returns: the figure to quote as what it sold), revenueBeforeReturns, returns, units, cost (what those units cost), grossProfit, marginPct, and changePct against previousRevenue (revenue before returns). Each row also carries revenueShare — its fraction of the listed products' revenue — and rankedRevenue is their combined total, so a breakdown by product needs no arithmetic of your own. mostProfitable lists them by grossProfit and highestMargin by marginPct (with enough units to mean something), each already ranked: use those lists, in their order, instead of ranking the rows yourself. Use when asked which products sell best, which are growing or slowing, which are most profitable, or for a breakdown of revenue by product. A null cost, grossProfit or margin means costs are missing for that product, not that it earns nothing — never treat a null as zero and never fill one in by subtracting. If truncated is true some orders had more line items than Shopify returns at once, so the split is partial — say so. Optional from and to (inclusive YYYY-MM-DD, both or neither, never after today) read another span instead of the default period. A named month, a week or two dates the operator gave MUST be sent here: without them this reads the default period (the one on the operator's screen, else the last 30 days), which is not that month. When the operator names no period, send neither.

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_top_products"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days.
fromNoFirst day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days.
limitNoHow many products, 1 to 50; omit for 10. Ask for more when the product in question is not in the top ten.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period."New value: +"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days."
    • changedInput schema / properties / to / description
      Previous value: -"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default 30-day period."New value: +"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days."
  2. Changed1 schema field changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "How many products, 1 to 50; omit for 10. Ask for more when the product in question is not in the top ten.",
      +  "maximum": 50,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / from / description
      Added value: +"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period."
    • addedInput schema / properties / to / description
      Added value: +"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default 30-day period."
  4. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), and the description adds substantial behavior on top: null cost/grossProfit/margin means missing data and must never be treated as zero, and truncated=true means the line-item split is partial and should be reported as such. It also explains that revenueShare and rankedRevenue are pre-computed so no arithmetic is needed, which prevents a common agent error.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the key ranking caveat are front-loaded, and most sentences carry unique information. However, it is one dense wall of text mixing return fields, null policy, truncation, and date-routing rules with no breaks, making it harder to scan than it needs to be for the amount of content.

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?

There is no output schema, so the description must carry the return contract, and it does: every field is named and defined, ordering is stated, and the two pre-ranked lists are explained. For a three-parameter read tool with full schema coverage, nothing an agent needs to call or interpret it correctly 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 the baseline is 3, but the description adds real meaning: 'both or neither' for from/to, 'never after today', and the instruction to raise limit when the product of interest is not in the top ten. It also clarifies the surprising default-period resolution logic (operator's screen, else last 30 days), which the schema states only briefly.

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 first sentence names the exact resource and ordering ("The products that earned the most in the current period... largest net sales first") and immediately discloses the default size and cap. Combined with the enumerated return fields, an agent can distinguish this from siblings like get_product_momentum or get_product_board without opening the schema.

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 concrete triggers ("which products sell best, which are growing or slowing, which are most profitable, or for a breakdown of revenue by product") and a strong routing rule for the date span: a named month or given dates MUST be sent here, otherwise omit both. The gap is that it never names an alternative tool to use instead, so overlapping cases such as product momentum are left to inference.

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