Skip to main content
Glama
tzangms

shopline-mcp

by tzangms

get_promotion_roi

Calculate ROI for each active promotion by comparing promotion items in orders with sales data over a specified date range. Returns order counts, revenue, discount amounts, and average discount per order.

Instructions

交叉比對促銷活動與銷售數據,計算各活動的 ROI。

【用途】取得指定時間區間內活躍的促銷活動,並比對訂單中的 promotion_items, 統計每個活動帶來的訂單數、營業額、折扣金額,計算平均每單折扣與折扣占比。 【呼叫的 Shopline API】

  • GET /v1/promotions(促銷活動列表)

  • GET /v1/orders/search(訂單查詢) 【回傳結構】dict 含 period、total_promotions、promotions(各活動 ROI 明細)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_dateYes結束日期 YYYY-MM-DD。建議與 start_date 維持較短區間以加快查詢。
start_dateYes起始日期 YYYY-MM-DD。⚠️ 本工具會逐頁掃描區間內所有訂單,區間越大越慢,請只查實際需要的最小區間(如單週或單月),避免一次查詢過長期間。
Behavior4/5

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

With no annotations, the description carries the transparency burden and does well by exposing the underlying API calls (GET /v1/promotions, GET /v1/orders/search), the page-by-page scanning behavior, and performance cost in the start_date warning. It implies read-only via GET but does not explicitly state side effects or rate limits.

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 well-structured with a one-line summary, 用途 section, API list, and return structure. Each section earns its place with distinct, useful information, and the purpose is front-loaded. There is no redundant 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?

The description covers purpose, method, underlying APIs, return shape, and performance caveats, which compensates for the lack of annotations and output schema. It could be slightly more precise about the exact ROI formula, but for an agent selecting and invoking the tool it is sufficiently 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 coverage is 100%, with both parameters already described in detail (including data format and performance warnings). The tool description itself adds no new parameter semantics beyond what the schema provides, so the baseline score of 3 applies.

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 action ('交叉比對促銷活動與銷售數據,計算各活動的 ROI') and clearly identifies the resource (promotions + sales data) and output (ROI per promotion). The 用途 section adds detail on computed metrics (order count, revenue, discount amount), making it distinct from siblings like list_promotions or get_promotion_analysis.

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 description gives clear usage context: retrieve promotions active in a date range and match order promotion_items. It also includes practical guidance to keep date ranges short for performance. However, it does not explicitly name alternatives or when-not-to-use conditions, 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/tzangms/shoplinemcp'

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