Skip to main content
Glama

出口单 chukoudan

PI 生成

pi
Read-onlyIdempotent

PI 生成(PI generator):算形式发票的小计、折扣、总计和定金。 Subtotal, discount, total and deposit of a proforma invoice. 输入为精确的十进制字符串 / Inputs are exact decimal strings. 只算形式发票(PI)上一行商品的金额:这一行的金额、折扣、运费、保险费、总额,以及定金和余款。商品有几行时,请用户到 chukoudan.com/pi/ 的页面里做,不要自己把几行拆开或加在一起算,绝不给错的总额。买方、卖方、银行、条款这些文字不在这里,也请用户到那个页面里填(内容只留在用户自己的浏览器里)。数量 quantity 和单价 unitPrice 必须是用户给的数,绝不要编;运费、保险费、折扣、定金比例没给就不要填。折扣 discount 默认是小计的百分数,discountBasis 填 percent;用户说的是一个金额,discountBasis 填 amount。discountBasis 只能写 percent 或 amount 这两个英文词,绝不要写 % 符号。 / Only the figures of ONE goods line of a proforma invoice: its amount, discount, freight, insurance, total, deposit and balance. For several lines the user goes to chukoudan.com/pi/; never split or add lines up yourself, so the total is never wrong. The parties, the bank and the terms are written on that page, not here. Never make up a quantity or a price; leave freight, insurance, discount and deposit rate out when the user gave none. discount is a percentage of the subtotal (discountBasis percent) unless it is an amount (discountBasis amount). discountBasis is exactly one of the two words percent or amount; never write the symbol %. 用户没有给的数字和日期不要自己编:必填的先问用户,选填的不填。 / Never make up a figure or a date the user did not give: ask for a required one, leave an optional one out. 回复时引用回答里的 provenance.source_line / Quote provenance.source_line in your reply. 结果仅供计算参考,不是税务、法律或投资意见;回答时请带上返回的说明和来源行。 / The result is for calculation and reference only, not tax, legal or investment advice; when you answer, pass on the returned notice and source line.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "lines": [
        {
          "quantity": "4500",
          "unitPrice": "7.04"
        },
        {
          "quantity": "12.5",
          "unitPrice": "3.333"
        },
        {
          "quantity": "3",
          "unitPrice": "0.125"
        }
      ],
      "freight": "1800",
      "currency": "USD",
      "discount": "5",
      "insurance": "95.5",
      "depositRate": "30",
      "discountBasis": "percent"
    },
    "name": "pi"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYes商品行 / Goods lines
freightNo运费 / Freight
currencyNo币种 / Currency
discountNo折扣 / Discount
insuranceNo保险费 / Insurance
issueDateNo开单日期 / Issue date
validUntilNo有效期至 / Valid until
depositRateNo定金比例(%) / Deposit rate (%)
discountBasisNo折扣方式。可选值:percent = 按比例(%);amount = 按金额 / Discount is. options: percent = A percentage (%); amount = An amount

Output Schema

NameRequiredDescriptionDefault
toolYes
linksYes
stepsYes
outputsYes
warningsYes
normalizedNo
provenanceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / description
      Previous value: -"数字最好写成字符串(十进制,如 \"12.5\"),JSON 数字也行;千位逗号只认 1,234,567 这种写法,小数点用英文句点,不要带货币符号或单位。币种可写 USD、usd 或 美元,单位可写 cm 或 厘米,日期可写 2026-05-01、2026/05/01 或 20260501。读不准的一律拒绝并说明原因,绝不猜;回答里的 normalized 列出实际采用的值。 / Figures are best sent as decimal strings such as \"12.5\"; a JSON number is accepted too. A thousands comma only as 1,234,567; the decimal point is a dot; no currency symbols or units. A currency may be USD, usd or 美元, a unit cm or 厘米, a date 2026-05-01, 2026/05/01 or 20260501. Anything that cannot be read in exactly one way is refused with a reason, never guessed; `normalized` in the answer lists what was used."New value: +"数字最好写成字符串(十进制,如 \"12.5\"),JSON 数字也行;千位逗号只认 1,234,567 这种写法,小数点用英文句点,不要带货币符号或单位。币种可写 USD、usd 或 美元,单位可写 cm 或 厘米,日期可写 2026-05-01、2026/05/01 或 20260501。读不准的一律拒绝并说明原因,绝不猜;回答里的 normalized 列出实际采用的值。 / Figures should be sent as decimal strings such as \"12.5\"; a JSON number is accepted too. A thousands comma only as 1,234,567; the decimal point is a dot; no currency symbols or units. A currency may be USD, usd or 美元, a unit cm or 厘米, a date 2026-05-01, 2026/05/01 or 20260501. Anything that cannot be read in exactly one way is refused with a reason, never guessed; `normalized` in the answer lists what was used."
  2. Changed1 schema field changed
    • changedOutput schema / $defs / PlainValue / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "amount": {
      -        "type": "string"
      -      },
      -      "currency": {
      -        "description": "An ISO 4217 code.",
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "money"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "amount",
      -      "currency"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "quantity"
      -      },
      -      "places": {
      -        "description": "How many decimal places the rounding rule keeps; pad to it, never round.",
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "unit": {
      -        "type": "string"
      -      },
      -      "value": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value",
      -      "unit"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "ratio"
      -      },
      -      "value": {
      -        "description": "A fraction: 0.13 is 13 %.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "base": {
      -        "type": "string"
      -      },
      -      "kind": {
      -        "const": "rate"
      -      },
      -      "per": {
      -        "description": "`per` units of `base` cost `value` units of `quote`.",
      -        "type": "string"
      -      },
      -      "quote": {
      -        "type": "string"
      -      },
      -      "value": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value",
      -      "base",
      -      "quote",
      -      "per"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "fractional": {
      -        "const": true
      -      },
      -      "grouping": {
      -        "const": false
      -      },
      -      "kind": {
      -        "const": "count"
      -      },
      -      "value": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "code"
      -      },
      -      "value": {
      -        "description": "A token from a fixed list the tool exports; the words for it are the copy key `<tool>.code.<value>`.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "kind": {
      -        "const": "date"
      -      },
      -      "value": {
      -        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "kind",
      -      "value"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "amount": {
      +        "type": "string"
      +      },
      +      "currency": {
      +        "description": "An ISO 4217 code.",
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "money"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "amount",
      +      "currency"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "quantity"
      +      },
      +      "places": {
      +        "description": "How many decimal places the rounding rule keeps; pad to it, never round.",
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "unit": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value",
      +      "unit"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "ratio"
      +      },
      +      "places": {
      +        "description": "How many decimal places of the fraction the rounding rule keeps; write the percentage padded to two fewer (0.2820 is 28.20 %), never round.",
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "value": {
      +        "description": "A fraction: 0.13 is 13 %.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "base": {
      +        "type": "string"
      +      },
      +      "kind": {
      +        "const": "rate"
      +      },
      +      "per": {
      +        "description": "`per` units of `base` cost `value` units of `quote`.",
      +        "type": "string"
      +      },
      +      "quote": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value",
      +      "base",
      +      "quote",
      +      "per"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "fractional": {
      +        "const": true
      +      },
      +      "grouping": {
      +        "const": false
      +      },
      +      "kind": {
      +        "const": "count"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "code"
      +      },
      +      "value": {
      +        "description": "A token from a fixed list the tool exports; the words for it are the copy key `<tool>.code.<value>`.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "date"
      +      },
      +      "value": {
      +        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "kind": {
      +        "const": "identifier"
      +      },
      +      "value": {
      +        "description": "A number that is data, such as a barcode number: write it as it is, keep its leading zeros, never group it.",
      +        "pattern": "^[A-Za-z0-9]{1,32}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "value"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Added

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is settled. The description adds genuine behavioral context: ambiguous input is refused with a reason rather than guessed, the answer carries a provenance.source_line and a notice that must be passed on. Some of this repeats the input schema's own text about refusal and normalized values, so it is useful but partly duplicative.

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 purpose is front-loaded and every rule is clear, but the full bilingual duplication roughly doubles length and the 'never make up a figure' warning recurs several times. The content earns its place; the packaging is heavier than necessary.

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

Completeness5/5

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

For a pure calculation tool with an output schema and full annotation coverage, nothing an agent needs is missing: decimal-string input format, single-line restriction, discount basis, optional-field omission, provenance and disclaimer handling are all covered.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: discount defaults to a percentage of the subtotal, discountBasis must be one of the two literal words and never the % symbol, and quantity/unitPrice must come from the user. That default-basis rule is the main semantic gain.

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?

States a specific verb and resource in both languages: computes subtotal, discount, total, deposit and balance for a proforma invoice. It also scopes the tool to exactly one goods line and explicitly rules out the multi-line case, which separates it from siblings like make_quote or baojia without the agent needing to open another schema.

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?

Gives explicit when-not guidance: with several goods lines the user must go to chukoudan.com/pi/ and the agent must never split or add lines itself. It also states field-level usage rules — omit freight, insurance, discount and deposit rate when not supplied, and ask only for required values — leaving little to inference.

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