Skip to main content
Glama

shop_analytics

Run sales analytics without writing SQL: retrieve top customers by spend, customers with most orders, top products, top categories, and revenue by year. Specify the operation, optional year, and limit.

Instructions

Shop aggregations without hand-written SQL.

Operations: top_customers_by_spend (name, email, total_amount; default limit 5), customer_most_orders (name, email, order_count), top_products (product_name, units_sold, revenue; default limit 5), top_categories (category, revenue; default limit 3), revenue_by_year (requires year). Spend/units/revenue use quantity * unit_price and exclude cancelled orders. Year is taken from order_date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNo
limitNo
operationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations present, the description carries the full behavioral burden. It reveals important behavior beyond a naive reading: spend, units, and revenue are computed as quantity * unit_price, cancelled orders are excluded, and year is taken from order_date. It also implies a read-only aggregation nature, though it doesn't explicitly state side-effect safety, cancellation behavior, or error conditions.

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?

The description is compact, structured, and front-loaded with the main purpose. It lists operations in a scannable format, then adds only the necessary computation caveats. Every sentence carries substantive information with no filler.

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?

Given an output schema exists, the description doesn't need to formally define return fields, and it does cover operation options, defaults, a special requirement, and calculation semantics. Remaining minor gaps are ambiguous behavior such as how customer_most_orders handles the limit parameter and what happens when an invalid combination of operation and year is given, but these do not block correct use in common cases.

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?

The schema provides 0% description coverage, so the description must explain the parameters, and it does: operation values map to concrete aggregations, limit has per-operation defaults, year is required for revenue_by_year, and all calculation semantics are explained. This goes well beyond the bare enum/schema and provides enough detail to invoke each operation correctly.

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 clearly states that this tool provides shop aggregations without hand-written SQL, and it enumerates exactly five named operations with their output fields. This distinguishes it from the SQL-oriented sibling tools (execute_readonly_sql) while making the tool's exact scope immediately evident.

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?

The phrase 'without hand-written SQL' effectively tells the agent to use this tool for shop aggregation reporting instead of writing SQL, and it names concrete operations such as top_customers_by_spend and revenue_by_year. It provides explicit per-operation constraints like the year requirement and default limits, though it does not explicitly state when to use a sibling tool like describe_table or execute_readonly_sql.

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/DrZeD-13/test-mcp-db'

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