Skip to main content
Glama

追加保证金

build_add_margin
Read-only

在不扩大持仓名义规模(sizeDeltaUsd = 0)的前提下,向已有仓位追加保证金以降低实际杠杆、拉远强平价(兼容 USDC 本位与 Meme 币本位,且不影响亏损挖矿加权持仓时间)。

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": {
      "account": "<account>",
      "market": "<market>",
      "side": "<side>"
    },
    "name": "build_add_margin"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYeslong 做多,short 做空
agentNoagent 专用通道:填 agent 自己的钱包地址后,交易由 agent 用自己的私钥直接签名发送,不用用户逐笔确认(用户需先用 build_agent_authorize 授权这个地址)。不填则由用户钱包签名
marketYes市场:短链接 slug、市场合约地址、代币地址、代币代号,或标的代号如 BTC / ETH / XAU(表示该标的的官方市场)
accountYes用户钱包地址(交易的签名人和收款人)
collateralUsdcNo追加的保证金金额(USDC 本位填 USDC 数量;Meme 币本位可按美元估算自动换算代币数,或直接传 collateralTokens)
collateralTokensNo仅 Meme 币本位永续市场使用:直接指定追加的 Meme 代币数量

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / collateralTokens / maximum
      Added value: +1000000000000000
  2. Changed3 schema fields changed
    • removedInput schema / properties / market / maxLength
      Removed value: -80
    • removedInput schema / properties / market / minLength
      Removed value: -1
    • removedInput schema / properties / market / type
      Removed value: -"string"
  3. First observed

TDQS

B3/5.0
Behavior1/5

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

The description frames the tool as actually adding margin to a live position ('向已有仓位追加保证金', reducing leverage, changing liquidation price) — a state-changing effect — while annotations declare readOnlyHint: true. The schema's 'agent' parameter ('交易由 agent 用自己的私钥直接签名发送') reinforces that a real transaction is sent, deepening the conflict. The description also never clarifies the build-vs-execute model or who signs, so an agent receives contradictory safety signals.

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?

One front-loaded sentence that puts the invariant (sizeDeltaUsd = 0) before the action and the outcomes; the parenthetical carries real content (collateral-type compatibility, no impact on loss-mining weighted time). Dense but no filler sentences.

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?

With no output schema and six parameters, the definition covers the economic intent and collateral modes but leaves out the signing/execution model, prerequisites (existing position, collateral balance, agent authorization), and the failure modes an agent would want to know. The core intent is present, but the surrounding context is thin for a margin-mutating tool.

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 all six parameters (including the USDC vs Meme-token collateral choice and the agent channel) are already documented in the schema. The description adds only the conceptual 'sizeDeltaUsd = 0' framing and the USDC/Meme compatibility note, which is a modest increment over the structured fields.

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?

States a specific verb+resource ('向已有仓位追加保证金') and pins the exact operational constraint (sizeDeltaUsd = 0), plus the intended effects (lower effective leverage, push liquidation price away). It does not name the inverse sibling build_remove_margin, so differentiation from that tool relies on the agent inferring it from the tool names alone.

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?

The use case is implied clearly (you want less leverage / a safer liquidation price on an existing position), and the sizeDeltaUsd = 0 note implicitly excludes opening or enlarging a position. However, there is no explicit 'use build_remove_margin instead when…', no statement that a position must already exist, and no prerequisite note about funding the collateral or authorizing an agent (the latter only appears in the schema).

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