Skip to main content
Glama

Get Top Selling Products

get_top_selling_products
Read-only

Returns the company's five best-selling products in a date range. start and end are full ISO 8601 timestamps such as 2026-04-01T00:00:00Z; omit both for the last 90 days. Call get_ecommerce_connection_status first and answer together with it: never report zero for a platform whose data is still syncing or not connected. It reads the active company; for another company the user owns, pass its companyId from list_companies instead of switching the active company.

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

Input Schema

NameRequiredDescriptionDefault
endNoOPTIONAL end as a FULL ISO 8601 timestamp WITH time + timezone, e.g. '2026-04-30T23:59:59Z'. Never date-only. Omit alongside `start` to fall back to the rolling 90-day window.
startNoOPTIONAL start as a FULL ISO 8601 timestamp WITH time + timezone, e.g. '2026-04-01T00:00:00Z'. Always include the time component and Z suffix — date-only strings (like '2026-04-01') are rejected by the upstream service. If the customer doesn't specify a date range, OMIT this and the tool defaults to the last 90 days.
contextNoOptional, for analytics only. In one sentence, why you are calling this tool and how it serves the user's goal. Describe the purpose in general terms: never include names, emails, phone numbers, addresses, IDs or any other personal details.
companyIdNoOPTIONAL. The doolaCompanyId (an id like '30E5c1AQA326uOuDlsic4No7zZ5'). LEAVE THIS EMPTY/UNSET to use the customer's currently active company — that is the correct default for almost every question. Pass a value ONLY when the customer explicitly references a *different* company they own (e.g. 'show me transactions for my other company X'). NEVER pass a company name, slug, or human label here — only an exact id string.
llm_modelNoOptional, for analytics only. Your exact model identifier from your system prompt (e.g. "claude-opus-4-8"), or "unknown" if unsure. Never guess.
conversation_idNoOptional, for analytics only. The exact conversation_id from this server's previous response, unchanged. The first response provides one, so leave this out until you have it and never invent one. Keep passing the same value for the rest of the conversation, even when the user moves on to a new request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare this a safe, closed, read-only operation, so the bar is lower, and the description adds real value by warning never to report zero while a platform is syncing or disconnected. It also discloses that it reads the active company unless companyId is passed. What it does not disclose is the return shape (revenue vs. units vs. product identity), which matters for interpreting a 'zero' result.

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

Conciseness2/5

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

Four sentences of dense, run-on clauses mix purpose, timestamp formatting, a prerequisite call, a data-freshness caveat, and multi-company routing into one block, so the most important caveat (never report zero while syncing) is buried mid-paragraph. Much of the timestamp guidance duplicates the schema and crowds out the more decision-relevant behavior.

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

Completeness3/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 carries the burden of describing what comes back, and it only says 'five best-selling products' without naming the fields (product name, units, revenue, platform). The prerequisite and company-routing guidance is thorough, but an agent still cannot anticipate the response shape or what 'top selling' is ranked by.

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 routing meaning beyond the schema by tying companyId to list_companies and warning against switching the active company. It also restates the ISO 8601 example and the 90-day omission default, which the schema already covers, so it is additive rather than fully compensating for any gap.

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 and resource ('Returns the company's five best-selling products') plus a scope qualifier ('in a date range'), so the agent knows both the entity and the count returned. This is distinguishable from order- or transaction-oriented siblings such as get_orders without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit operational sequencing ('Call get_ecommerce_connection_status first and answer together with it') and an explicit cross-company path ('pass its companyId from list_companies instead of switching the active company'). It also states the default path when no range is supplied, leaving nothing 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.