Skip to main content
Glama

MiaoToolbox (妙用盒)

单利 / 复利 / 定投 / IRR / 分期真实年化(妙用盒)

calculate_interest
Read-onlyIdempotent

使用 50 位十进制精度试算五种理财与分期模型:simple(单利)、compound(复利与有效年利率 EAR)、sip(定期定投)、irr(现金流内部收益率,2–120 期)、installment_apr(分期/消费贷/砍头息真实年化,同时返回复利 EAR 与单利 APR)。默认仅返回汇总;compound/sip 如需分期明细可设 includeSchedule=true 并分页(最多 24 期)。

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": {
      "mode": "<mode>"
    },
    "name": "calculate_interest"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYes试算模式:simple / compound / sip / irr / installment_apr
termNo【simple/compound】投资期限数值
yearsNo【compound】投资年数(与 term/termUnit 二选一)
monthsNo【installment_apr】分期总期数(2–120 月)
timingNo【sip】扣款时机:end(期末,默认)或 begin(期初)end
periodsNo【sip】定投总期数(1–600)
termUnitNo【simple/compound】期限单位:year / month / day(默认 year)
cashFlowsNo【irr】现金流数组(2–120 期,负数为投入、正数为回流,至少 1 次符号变化)
frequencyNo【sip/irr】频率:sip 支持 monthly/weekly/yearly;irr 支持 yearly/quarterly/monthly
inputModeNo【installment_apr】分期输入方式:fixed_payment / monthly_fee_rate / total_repayment
principalNo【simple/compound/installment_apr】本金(元)
upfrontFeeNo【installment_apr】期初一次性扣除手续费/砍头息(元,默认 0)
compoundingNo【compound】复利计息频率monthly
scheduleLimitNo【compound/sip】明细每页条数(1–24)
scheduleStartNo【compound/sip】明细起始期数(从 1 开始)
monthlyPaymentNo【installment_apr:fixed_payment】每期固定还款额(元)
totalRepaymentNo【installment_apr:total_repayment】分期总还款额(元)
includeScheduleNo【compound/sip】是否附带分期明细(默认 false)
initialPrincipalNo【sip】初始本金(元,默认 0)
annualRatePercentNo【simple/compound/sip】年利率或预期年化收益率(%,0–1000)
periodicContributionNo【sip】每期定投金额(元)
monthlyFeeRatePercentNo【installment_apr:monthly_fee_rate】宣传月费率(%,如 0.5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / inputMode
      Added value: +{
      +  "description": "【installment_apr】分期输入方式:fixed_payment / monthly_fee_rate / total_repayment",
      +  "enum": [
      +    "fixed_payment",
      +    "monthly_fee_rate",
      +    "total_repayment"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / mode / description
      Previous value: -"试算模式:simple / compound / sip / irr"New value: +"试算模式:simple / compound / sip / irr / installment_apr"
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "simple",
      -  "compound",
      -  "sip",
      -  "irr"
      -]New value: +[
      +  "simple",
      +  "compound",
      +  "sip",
      +  "irr",
      +  "installment_apr"
      +]
    • addedInput schema / properties / monthlyFeeRatePercent
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "maxLength": 80,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  ],
      +  "description": "【installment_apr:monthly_fee_rate】宣传月费率(%,如 0.5)"
      +}
    • addedInput schema / properties / monthlyPayment
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "maxLength": 80,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  ],
      +  "description": "【installment_apr:fixed_payment】每期固定还款额(元)"
      +}
    • addedInput schema / properties / months
      Added value: +{
      +  "description": "【installment_apr】分期总期数(2–120 月)",
      +  "maximum": 120,
      +  "minimum": 2,
      +  "type": "integer"
      +}
    • changedInput schema / properties / principal / description
      Previous value: -"【simple/compound】本金(元,>0 且 <=1万亿)"New value: +"【simple/compound/installment_apr】本金(元)"
    • addedInput schema / properties / totalRepayment
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "maxLength": 80,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  ],
      +  "description": "【installment_apr:total_repayment】分期总还款额(元)"
      +}
    • addedInput schema / properties / upfrontFee
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "maxLength": 80,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  ],
      +  "description": "【installment_apr】期初一次性扣除手续费/砍头息(元,默认 0)"
      +}
  2. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and a closed world, so safety is covered. The description adds genuinely new behavioral facts: 50-digit decimal precision, summary-only return by default, schedule detail only for compound and sip, and a hard 24-period page cap with pagination. It does not mention validation failures (e.g. irr requiring a sign change) beyond what the schema already says.

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?

It is a single dense sentence that front-loads the five modes and pushes defaults and pagination to the tail, with zero filler. The mode list is long but each item earns its place by disambiguating an enum value; a slightly tighter grouping of the schedule/pagination clause would improve scanability.

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

Completeness3/5

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

For a 22-parameter, mode-switched tool this covers the mode taxonomy and the schedule behavior, which is the main complexity. But with no output schema, the description only sketches return values (summary by default, EAR and APR for installment_apr) and says nothing about the summary fields for simple/compound/sip/irr, leaving the agent unable to anticipate the response shape.

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 every parameter already carries a bracketed mode tag and unit hint, so the schema does the heavy lifting and a 3 is the baseline. The description reinforces the includeSchedule/scheduleLimit pairing and the 24-period ceiling, but adds no interpretation of ambiguous fields such as inputMode or term vs years precedence that is not already in the schema.

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 verb (试算) and resource (五种理财与分期模型) and then enumerates all five modes with a one-phrase gloss each (simple 单利, compound 复利与 EAR, sip 定投, irr 内部收益率, installment_apr 真实年化). An agent can tell exactly what the tool computes and which mode key maps to which computation, and no sibling tool in the catalog (tax, mortgage, date, unit conversion) overlaps this domain.

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

Usage Guidelines3/5

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

Mode selection guidance is implied by the parenthetical definitions of each mode, and the description states the default behavior (仅返回汇总) and the opt-in includeSchedule path. However, it never states an explicit when-to-use framing, prerequisites for each mode, or when a caller should reach for calculate_mortgage_plus instead when dealing with installment-style loans, so the agent must infer routing from enum names.

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