Skip to main content
Glama

Liuwangcun Chinese Compliance Tools

毛利率与加价率计算

gross-margin

毛利率与加价率计算:输入售价与成本,同时算毛利率、加价率、毛利额。电商定价最容易混乱的就是把毛利率当加价率,本工具把两个口径分开列,附公式。 传入参数对象,返回确定性计算结果与依据。适用场景:模型算数不稳、法规口径易错时,调用它拿准确答案。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "price": "<price>",
      "cost": "<cost>"
    },
    "name": "gross-margin"
  }
}

Input Schema

NameRequiredDescriptionDefault
costYes成本(元)
priceYes售价/收入(元)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.6/5.0
Behavior3/5

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

There are no annotations, so the description must carry the entire behavioral burden. It does disclose that output is deterministic, that it lists both metrics separately with formulas attached, and that it is a three-value calculator. It does not cover edge cases such as a zero cost causing a division-by-zero when computing the markup rate, nor any floor or validation behavior for negative inputs, leaving real gaps for a numeric tool.

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?

The definition is short and front-loaded: it states what is computed, then explains the margin-versus-markup distinction, then appends the use case. One sentence ('传入参数对象,返回确定性计算结果与依据') is largely boilerplate, but the rest earns its place.

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 simple two-parameter calculator with no output schema and no annotations, the description covers purpose, the values returned, and the invocation scenario, which is enough to call it correctly. Only edge-case behavior (zero cost, negative values) is missing, which is a minor gap at this complexity level.

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% and both parameters are already documented as price (售价/收入) and cost (成本, in yuan). The description restates the same two inputs without adding unit conventions, accepted ranges, or handling of zero, so it adds no meaning beyond the schema. The baseline of 3 applies.

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 names a specific verb and resource: it takes price and cost and returns gross margin rate, markup rate, and gross profit amount. It also clarifies the key distinction between margin and markup, which is the main confusion the tool resolves. It stops short of naming a sibling for contrast (e.g. discount-price or breakeven-point), so the boundary with adjacent calculators is only implicit.

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 an explicit usage trigger: call it when model arithmetic is unreliable or when regulatory definitions are easy to get wrong. That is clear context for when to invoke it. It offers no when-not guidance and does not point to alternatives, so it lands at clear-context-without-exclusions rather than full routing.

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.

Resources