Skip to main content
Glama

跨 Agent 结算转账

settlement.transfer
Destructive

在跨 Agent 结算账户间原子转账 credits,写入不可篡改哈希链流水,幂等键防重放,用于多 Agent 任务结算/分账。Example: {"from_account":"orchestrator","to_account":"agent-a","amount":5,"idempotency_key":"settle-001"}

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": {
      "amount": 5,
      "reason": "task.complete",
      "to_account": "agent-a",
      "from_account": "orchestrator",
      "idempotency_key": "settle-001"
    },
    "name": "settlement.transfer"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitNo结算单位,默认 credits
amountYes结算金额(正数)
reasonNo结算原因(可选)
to_accountYes收款方账户
from_accountYes付款方账户
idempotency_keyNo幂等键,防重放(建议)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / amount / description
      Previous value: -"结算金额(credits,正数,最多 6 位小数)"New value: +"结算金额(正数)"
    • changedInput schema / properties / from_account / description
      Previous value: -"付款方账户(发起结算的 Agent/组织)"New value: +"付款方账户"
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"幂等键:重复提交同一键不会重复结算,直接返回原交易(强烈建议,用于网络重试安全)"New value: +"幂等键,防重放(建议)"
    • changedInput schema / properties / reason / description
      Previous value: -"结算原因,如 task.complete、tool.cost、resource.read(可选)"New value: +"结算原因(可选)"
    • changedInput schema / properties / to_account / description
      Previous value: -"收款方账户(被结算的 Agent/组织)"New value: +"收款方账户"
    • changedInput schema / properties / unit / description
      Previous value: -"结算单位,默认 credits(可选)"New value: +"结算单位,默认 credits"
  2. Added

TDQS

A3.6/5.0
Behavior4/5

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

The annotations declare destructiveHint=true and idempotentHint=false, and the description adds substantive context on top of them: the transfer is atomic, the ledger entry is written to an immutable hash chain, and the idempotency key guards against replay. Together these tell the agent that the operation moves real funds and is irreversible. The description still leaves unstated what happens when funds are insufficient and how failures are surfaced, and it does not mention the idempotentHint=false tension explicitly; the idempotency key is described as optional ('建议'), so the description does not outright contradict the annotations, but it is worth flagging.

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 one dense sentence followed by a concrete example, both front-loaded: the core action and its guarantees (atomic, hash-chained, idempotent) come first, before the use case. It contains no filler. The example duplicates the schema's examples field, so it is slightly redundant but still useful for reinforcing the idempotency_key naming.

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?

This is a six-parameter, partially required (3 of 6) mutation tool with no output schema; the description therefore must explain the outcome and it does not. It is silent on what the call returns to the agent (transaction hash, updated balances, ledger position) and on failure modes such as insufficient balance or a duplicate idempotency key. Its coverage of atomicity and immutability is strong, but those omissions leave the agent less prepared to call this tool correctly.

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%, so the schema already documents all six parameters, including unit, amount, reason, to_account, from_account, and idempotency_key. The description's inline example demonstrates a realistic call shape and reinforces that the idempotency key is the replay guard. However, it adds no constraint details beyond the schema and omits reason and unit from the example. Baseline 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 states a specific verb and resource: an atomic transfer of credits between cross-Agent settlement accounts, with an immutable hash-chain ledger entry and an idempotency key preventing replay. That is precise and agent-legible. It does not, however, distinguish itself from the sibling tools settlement.account and settlement.ledger, so the agent must infer whether this is the right settlement tool to call.

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?

"用于多 Agent 任务结算/分账" gives a stated usage context: settling or splitting payments for multi-agent tasks. There is no explicit guidance on when not to use it, no mention of settlement.account or settlement.ledger as alternatives, and no prerequisites such as the payer needing sufficient balance. Usage is implied rather than fully directed.

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.