Skip to main content
Glama

减少保证金

build_remove_margin
Read-only

在不缩减持仓名义规模(sizeDeltaUsd = 0)的前提下,从已有仓位提取多余保证金(兼容 USDC 本位与 Meme 币本位;仅可提取超出最高杠杆要求且满足链上最低 2 USD 保底线门槛的自有本金,未实现浮盈需平仓提取)。

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_remove_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

A3.6/5.0
Behavior3/5

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

The description adds real economic behavior beyond the annotations: the withdrawable-amount rule (excess over max leverage, ≥2 USD maintenance), the cross-margin compatibility (USDC and Meme token based), and the PnL carve-out. However, it never reconciles the mutation-sounding action ('提取保证金' from a live position) with readOnlyHint=true — it does not state that this only constructs an unsigned transaction for the user or agent to sign, which is the single most important behavioral fact for an agent here.

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?

A single front-loaded sentence that leads with the key invariant (sizeDeltaUsd = 0) and then the eligibility rules, with zero filler. It is dense — three parenthetical qualifiers in one sentence — but every clause carries operational meaning.

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 six-parameter transaction tool with no output schema, the description covers purpose and eligibility well but omits what the call actually returns (an unsigned transaction payload) and who must sign it, leaving the agent to reconstruct that from the `agent` parameter description. The readOnly/state-change ambiguity also remains unresolved at the description 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%, so market, account, agent, side, collateralUsdc and collateralTokens are already documented in-schema, including the USDC-vs-Meme-token unit distinction. The description adds only the high-level 'extract margin' framing and does not explain the collateralUsdc / collateralTokens selection or the 2 USD floor's interaction with the amount. Baseline 3 applies when the schema carries the parameter burden.

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 gives a specific verb+resource: extracting excess margin from an existing position, gated by the explicit constraint sizeDeltaUsd = 0, which cleanly separates it from build_close_position (reduces size) and build_add_margin (the inverse direction). It never names the counterpart tool, so the contrast is inferable rather than stated, which keeps it just under a 5.

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?

It states the operative preconditions clearly: only principal above the maximum-leverage requirement and above the on-chain 2 USD maintenance floor is withdrawable, and unrealized PnL cannot be pulled out. The clause '未实现浮盈需平仓提取' effectively tells the agent to route to a close-position flow in that case. No explicit tool name is given as an alternative, so it is clear context without full when-not 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