Skip to main content
Glama

get_top_products

Get top selling products ranked by revenue or quantity. Set level to 'variant' to break down by variant (size, colour, etc.) — includes SKU, discount, and profit margin when cost data is available. Set level to 'category' for a revenue / COGS / gross-profit / margin-% rollup by product TYPE (e.g. 'Sewing Machines vs Fabric') — the structured answer to category-P&L / margin-by-category questions (margin is computed only over cost-configured units, with a costCoveragePercent per category). Optionally filter variants by productTitle. Supports compare for WoW/MoM/YoY trend — returns top 5 rising/falling/new products with the comparison.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoGrouping level: product (default), variant (by size/colour/SKU), or category (revenue/COGS/gross-profit/margin by product type)
limitNoNumber of results (default: 10)
metricNoSort by: revenue or quantity (default: revenue)
_offsetNoPagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page.
compareNoAttach a `comparison` block with the top rising/falling/new products vs the WoW/MoM/YoY/previous-period window.
endDateNoEnd date (YYYY-MM-DD)
startDateNoStart date (YYYY-MM-DD)
productTitleNoFor variant level: filter to variants of a specific product (partial match)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that margin/SKU/discount appear only 'when cost data is available', that margin is computed only over cost-configured units with a costCoveragePercent, and that compare returns the top 5 rising/falling/new products. It omits anything about permissions, defaults for date range, or pagination/latency behavior.

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-loads the core purpose in the first sentence and then layers level-specific detail in order of the enum. It is long and clause-heavy with em-dash asides, but each clause carries information rather than filler, so the density is justified.

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?

For an 8-parameter, no-annotation, no-output-schema tool this is close to complete: it explains each level's return shape, the cost-data caveat, and compare semantics. The remaining gap is that it never states the implicit date-range default or that startDate/endDate scope the ranking, which an agent must infer.

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 100%, so the baseline is 3, but the description adds real meaning beyond the schema — the variant breakdown fields, the category cost-coverage caveat, and the semantic content of the `comparison` block that the schema only labels generically. It does not, however, explain level defaults or the format expectations beyond the schema's own text.

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 ('Get top selling products ranked by revenue or quantity') and then crisply distinguishes the three behaviors keyed off the `level` enum, including what each returns (SKU/discount/margin at variant, revenue/COGS/GP/margin-% rollup at category). An agent can immediately tell this apart from get_product_analytics or get_products_by_channel.

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?

Gives explicit when-to-use guidance for each level: 'variant' to break down by variant, 'category' for category-P&L / margin-by-category questions, and compare for WoW/MoM/YoY trend. It does not name a competing sibling to defer to (e.g. get_product_analytics) or state when NOT to use this tool, so it falls short of a 5.

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