Skip to main content
Glama

开仓

build_open_position
Read-only

生成开仓交易(支持 USDC 本位与 Meme 币本位永续,市价或限价),可同时挂止盈、止损并可选绑定邀请码 referralCode,一笔交易完成。返回预计成交价、可接受价、执行费和待签 steps(含精确额度授权)。

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>",
      "collateralUsdc": "<collateralUsdc>",
      "leverage": "<leverage>",
      "slippagePct": "<slippagePct>"
    },
    "name": "build_open_position"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYeslong 做多,short 做空
agentNoagent 专用通道:填 agent 自己的钱包地址后,交易由 agent 用自己的私钥直接签名发送,不用用户逐笔确认(用户需先用 build_agent_authorize 授权这个地址)。不填则由用户钱包签名
marketYes市场:短链接 slug、市场合约地址、代币地址、代币代号,或标的代号如 BTC / ETH / XAU(表示该标的的官方市场)
accountYes用户钱包地址(交易的签名人和收款人)
leverageYes杠杆倍数,不超过该市场最大杠杆
stopLossNo止损触发价
limitPriceNo限价开仓的触发价;不填为市价
takeProfitNo止盈触发价
slippagePctYes滑点百分数,默认 0.3(即 0.3%)
referralCodeNo可选推广邀请码(可读短码如 alice 或 0x 开头的 32 字节十六进制;子账户模式下忽略)
collateralUsdcYes保证金美元金额(USDC 本位市场为 USDC 金额,扣掉买卖价差后不少于 10;币本位市场按当前链上中间价折算为对应 Meme 代币枚数)
collateralTokensNo仅币本位永续市场可选:直接按 Meme 代币枚数覆盖保证金数量

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / collateralTokens / maximum
      Added value: +1000000000000000
    • addedInput schema / properties / collateralUsdc / maximum
      Added value: +100000000
    • addedInput schema / properties / limitPrice / maximum
      Added value: +1000000000000
    • addedInput schema / properties / stopLoss / maximum
      Added value: +1000000000000
    • addedInput schema / properties / takeProfit / maximum
      Added value: +1000000000000
  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.9/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, so the description's job is to explain the mechanics, which it does: it discloses the return payload (预计成交价、可接受价、执行费) and that the result is 待签 steps including exact allowance approvals. That tells the agent the transaction is not executed and requires a separate signing step. It stops short of describing failure modes, order expiry, or what happens to existing positions.

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?

Two compact clauses: the first front-loads what is built and its supported variants, the second front-loads what is returned. No filler or repetition of the title. Slightly dense with parentheticals, but every clause earns its place.

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

Completeness4/5

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

For a 12-parameter transaction builder with no output schema, the description compensates by summarizing the return shape (prices, fee, steps with approvals) and the supported market/order variants. The main remaining gap is the absence of explicit routing guidance among the many build_* siblings, which matters at this complexity 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 the schema already documents all 12 parameters in detail, including the USDC-vs-token interpretation of collateralUsdc and the agent signing channel. The description reinforces a few semantics (referralCode optionality, TP/SL attachable in the same call) but adds no format or constraint detail beyond the schema, so the baseline 3 applies.

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 states a concrete verb and resource ('生成开仓交易') and immediately scopes it: USDC-margined and Meme-coin-margined perpetuals, market or limit orders, optional TP/SL and referral binding. An agent can tell this apart from build_close_position, build_add_margin or build_set_tp_sl without opening the schema, and it clarifies that the output is an unsigned transaction rather than an executed trade.

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?

Usage is only implied: '可同时挂止盈、止损…一笔交易完成' hints that TP/SL can be attached here instead of calling build_set_tp_sl separately, and the agent parameter notes that build_agent_authorize must run first. However, the main description body never states when to prefer this tool over siblings (e.g. market vs limit routing, or agent vs user signing) nor any preconditions or exclusions.

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