Skip to main content
Glama

top_products

Rank products by units sold or revenue from completed and shipped orders, using actual sale prices to compute revenue. Returns product names, units sold, and revenue for informed inventory and sales analysis.

Instructions

Rank products by units sold (metric='units', default) or by revenue (metric='revenue'). Only 'completed' and 'shipped' orders count. Money is computed from order_items.unit_price (the actual sale price), not the current products.price. Returns a list of {name, units_sold, revenue}. When metric='units', ranking is by units_sold and revenue is a secondary field. limit defaults to 100 (max 1000); offset paginates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
metricNounits
offsetNo
Behavior5/5

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

With no annotations, the description carries full behavioral burden and does so thoroughly. It discloses the order-status filter, that money is computed from order_items.unit_price rather than current products.price, that ranking changes with metric, and the exact result fields.

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?

Five dense sentences, each serving a distinct purpose: the core action, status filter, revenue derivation, result shape, and pagination defaults. The most important information is front-loaded and there is no filler.

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 there is no output schema and no annotations, the description is complete: it states result structure, metric-dependent ranking behavior, critical data source rule, status filtering, and limits. Minor assumptions like descending order are natural from the concept of ranking.

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 0%, so the description must compensate—and it does. It defines the metric options and behaviors, clarifies the default limit of 100 and maximum of 1000, and explains offset pagination. This goes well beyond the raw schema.

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 opens with a specific verb+resource: 'Rank products by units sold or revenue.' It clearly distinguishes what this tool computes from sibling tools like top_customers and revenue_by_category, without any ambiguity about scope.

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 provides clear operational usage context: valid metric values, default and max limit, pagination, and which order statuses are included. It does not explicitly name sibling tools or state when to prefer an alternative, so it stops 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.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ablinovsibset-spec/internet-shop-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server