Skip to main content
Glama

Get order stats

get_order_stats
Read-onlyIdempotent

Use this tool when the user asks how many orders or how much revenue their Convika pages brought, which page sells best, or which source or campaign brings orders: 「どのページが一番売れてる?」「Instagram からの注文は?」「今月の売上」「ChatGPT から来た注文は?」.

Returns the orders and revenue in the period, by page and by traffic source (the source an order recorded from the page view that led to it: UTM source, medium, or campaign, or the referring site; "(none)" when it had none). byArrival splits the same orders into those whose buyer came from an AI assistant (ai, and assistants: each assistant by name, one of "chatgpt.com", "perplexity.ai", "claude.ai", "gemini.google.com", "copilot.microsoft.com", "grok.com", "chat.deepseek.com", "meta.ai") and the rest (other), from the link's utm_source or the referring site of the page view that led to the order. It counts orders placed (not test, spam, duplicates, or declined, cancelled, refunded, or unpaid card orders); revenue counts paid orders (cash on delivery once accepted), less refunds. Amounts are in the currency's main unit as text.

Orders hold no visitor id, so they aren't joined to visitors: for a page with an "order" goal, conversion totals in the analytics tools are estimates (conversionsEstimated). For traffic and orders by source side by side, use analyze_source_quality.

On Free, counts and totals include the first 50 cash-on-delivery, bank-transfer, and payment-link orders of each UTC month; orders past that aren't counted (get_orders still lists them), omittedOverCap says how many, and the dashboard's Orders page lists them all. Pro and above have no cap. startDate and endDate are whole days (YYYY-MM-DD) in timeZone, UTC when left out; leave both out for all time.

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

Input Schema

NameRequiredDescriptionDefault
siteIdNoOnly this page. Leave out for every page.
endDateNoLast day, YYYY-MM-DD
timeZoneNoIANA time zone name for the days in this response, such as America/New_York, Europe/Berlin, or Asia/Tokyo. Leave it out for the workspace's time zone (UTC when none is set). It affects only this response: the workspace's time zone stays as it is, and only the workspace's owner changes it, in the dashboard's Settings. Abbreviations such as EST and offsets such as +09:00 aren't accepted.
startDateNoFirst day, YYYY-MM-DD
sourceDimensionNoWhat bySource groups by. Defaults to utm_source.utm_source

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

The annotations already declare readOnly, idempotent, closed-world, non-destructive behavior, and the description far exceeds that floor: it defines exactly which orders count (excludes test, spam, duplicates, declined, cancelled, refunded, unpaid card orders) and how revenue is computed (paid orders, COD once accepted, less refunds). It also discloses the Free-plan cap of 50 orders per UTC month with omittedOverCap, the conversionsEstimated caveat from the missing visitor id, and text-formatted currency amounts. A slight gap remains around pagination and response shape limits, but the behavioral disclosure is unusually thorough.

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?

Structure is well front-loaded: usage triggers first, then return contents, then counting rules and plan limits. It is dense and long, with an enumerated list of eight AI-assistant domains and parenthetical asides that could be tightened, but nearly every sentence delivers decision-relevant information rather than restating the schema.

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?

For a five-parameter read tool with no output schema, it supplies the return shape (byPage, bySource, byArrival with ai/assistants/other, omittedOverCap, conversionsEstimated), the counting and revenue rules, and the plan-dependent coverage caveat. Nothing an agent needs in order to call it correctly or interpret its results 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: startDate and endDate are whole days interpreted in timeZone (UTC when omitted) and leaving both out means all time, and bySource groups by sourceDimension. It explains how (none) values and the utm_source-or-referrer fallback are assigned, which the schema does not.

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 states a specific verb and resource (returns orders and revenue for a period, broken down by page and traffic source) and names its breakdown dimensions byPage, bySource, and byArrival. It is clearly distinguished from the sibling get_orders (raw list) and analyze_source_quality (traffic vs. orders side by side), so an agent can choose 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 Guidelines5/5

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

It opens with explicit trigger conditions ('when the user asks how many orders or how much revenue…, which page sells best, or which source or campaign brings orders') and includes concrete sample utterances. It also names the alternative for a related need ('For traffic and orders by source side by side, use analyze_source_quality') and notes that get_orders still lists orders excluded by the free-tier cap, which is exactly the when-not guidance.

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.