Skip to main content
Glama
sbguangha

agent-gateway

by sbguangha

biz_query_sales

Retrieve GMV, order count, and refund rate for a date range, filtered by SKU, shop, or channel, and grouped by day, week, or category to answer structured sales questions.

Instructions

【销售查询】按结构化过滤汇总 GMV / 订单 / 退款率。

【硬约束】只能用本工具的过滤字段,禁止拼接 SQL。 【group_by】day / week / sku / category / channel / shop。 【ID 从哪来】sku_id 来自结果或 biz_get_sku;shop_id 为 SHOP-TM / SHOP-DY / SHOP-OS; channel_id 为 tmall / douyin / independent / xiaohongshu。不要编造 SKU。 【金额】gmv_cent 为分,展示时除以 100。 【何时用】「上周哪个 SKU GMV 最高」「音频类目 8 月退款率」。 【何时不用】只要异常对比 → biz_anomaly_scan;只要单订单 → biz_get_order。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
sku_idNo
shop_idNo
categoryNo
end_dateNo
group_byNoday
channel_idNo
start_dateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it states the hard constraint '禁止拼接 SQL', explains that gmv_cent is in cents and must be divided by 100, and clarifies which ID sources are valid. It does not cover date-range defaults or pagination behavior, but the disclosed constraints and unit handling are substantial.

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 scannable and organized into labeled sections, with the core purpose first followed by constraints, ID guidance, and routing rules. Every section communicates a distinct operational fact, and there is no filler or redundant restating of the tool name.

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 a tool with 8 optional parameters rate and an output schema present, the description covers purpose, usage boundaries, ID namespaces, grouping options, and unit conversion. It stops short of specifying date formats and category values, which are relevant to correct invocation, so it is not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains group_by allowed values, shop_id formats, channel_id values, and sku_id sourcing. However, it does not clarify date format for start_date/end_date, valid category values, or limit semantics, leaving meaningful gaps for an agent invoking the tool.

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 clear verb and resource: '按结构化过滤汇总 GMV / 订单 / 退款率' (aggregate GMV/orders/refund rate by structured filters). It further differentiates itself from siblings by explicitly stating when to use biz_anomaly_scan or biz_get_order instead, so an agent can reliably select it.

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 provides explicit '【何时用】' examples and '【何时不用】' alternatives, naming sibling tools. It also gives hard constraints like prohibiting raw SQL and instructing where to source IDs, which tells the agent not only when but how to use the tool correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.