Skip to main content
Glama

rms_cancel_rate

Retrieve cancellation rates and counts for orders within a specified date range.

Instructions

Cancellation rate and counts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNoYYYY-MM-DD
end_dateNoYYYY-MM-DD

Implementation Reference

  • The actual handler function for rms_cancel_rate. Computes cancellation rate by fetching all orders and those with progress 800 (cancel pending) or 900 (cancelled), then returns the rate as a percentage.
    async def _cancel_rate(args: dict, api: OrderAPI) -> list[TextContent]:
        now = _now()
        start = datetime.fromisoformat(args.get("start_date", (now - timedelta(days=30)).strftime("%Y-%m-%d")))
        end = datetime.fromisoformat(args.get("end_date", now.strftime("%Y-%m-%d")))
        end = end.replace(hour=23, minute=59, second=59)
    
        all_r = api.search_orders(_to_rms(start), _to_rms(end))
        total = len(all_r.get("orderNumberList", []))
        cancel_r = api.search_orders(_to_rms(start), _to_rms(end), progress_list=[800, 900])
        cancelled = len(cancel_r.get("orderNumberList", []))
        rate = (cancelled / total * 100) if total else 0
        return [TextContent(type="text", text=f"# RMS Cancel Rate: {start.date()} ~ {end.date()}\n- Total: {total}\n- Cancelled: {cancelled}\n- Rate: {rate:.1f}%")]
  • Tool definition / schema for rms_cancel_rate. Declares the tool name, description, and input schema (start_date and end_date strings).
    Tool(name="rms_cancel_rate", description="Cancellation rate and counts",
         inputSchema={"type": "object", "properties": {
             "start_date": {"type": "string", "description": "YYYY-MM-DD"},
             "end_date": {"type": "string", "description": "YYYY-MM-DD"},
         }}),
  • Registration dispatch: routes the tool name 'rms_cancel_rate' to the _cancel_rate handler function when call_tool is invoked.
        elif name == "rms_cancel_rate":
            return await _cancel_rate(arguments, api)
        return [TextContent(type="text", text=f"Unknown: {name}")]
    finally:
        c.close()
  • OrderAPI.search_orders helper used by _cancel_rate to query orders by date range and optionally filter by progress list (e.g., [800, 900] for cancellations).
    def search_orders(self, start_date: str, end_date: str, *,
                      date_type: int = 1, progress_list: list[int] | None = None) -> dict:
        payload: dict[str, Any] = {
            "dateType": date_type,
            "startDatetime": start_date,
            "endDatetime": end_date,
        }
        if progress_list is not None:
            payload["orderProgressList"] = progress_list
        return self._c.post("/order/searchOrder/", json=payload).json()
Behavior2/5

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

No annotations provided, and the description fails to disclose behavioral traits such as read-only nature, data aggregation behavior, or any side effects. The tool's purpose implies read-only, but this is not explicitly stated.

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

Conciseness3/5

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

The description is extremely concise but is a noun phrase rather than a complete sentence. It could be improved with a verb for clarity without adding significant length.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, and the description does not explain the return format (e.g., daily totals, overall rate). Missing details on what 'rate' means (percentage, fraction) and whether counts are segmented.

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 100% but only provides format (YYYY-MM-DD). The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it provides cancellation rate and counts, which is distinct from sibling tools like rms_daily_sales. However, it lacks a verb and could be more specific about the output format.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus siblings or alternatives. The description does not mention prerequisites, context, or exclusions.

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/yasuhidekoizumi-afk/rms-mcp'

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