Skip to main content
Glama

开仓

build_open_position
Read-only

Builds market or limit USDC- or meme-collateralized perpetual open-position transactions with optional take-profit, stop-loss, referral code, and unsigned approval steps for signing.

Instructions

生成开仓交易(支持 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. First observedv1.0.0

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, which reads as odd for a trade builder until the description clarifies it returns 待签 steps rather than executing anything — that is genuine added context, not a contradiction. The description also discloses the return payload (预计成交价、可接受价、执行费、含精确额度授权的 steps) and the one-transaction bundling behavior, though it says nothing about permissions, rate limits, or what happens if signing is abandoned.

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?

Purpose is front-loaded in the first clause and the return contract closes the sentence, with no filler. It is a single dense sentence with nested parentheticals, which slightly hurts scanability but wastes no words.

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 builder with no output schema, the description covers order types, optional attachments, and the shape of the returned steps, and pairs with a fully documented schema for the rest. The main residual gap is guidance on agent-mode vs user-signing flows, which is only discoverable from the schema's `agent` field.

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%, including detailed notes on agent-mode signing, collateralUsdc vs collateralTokens semantics, and slippage defaults, so the schema does the heavy lifting. The description restates the TP/SL and referralCode options but adds no semantics beyond what the schema already documents; 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?

"生成开仓交易" is a specific verb+resource, and the description immediately scopes it: USDC-margined and Meme-coin-margined perpetuals, market or limit, with optional bundled TP/SL and referral binding. An agent can tell this is the order-construction tool for opening positions, distinct from close/add-margin siblings named in the catalog.

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 implied by the contents (open a position, attach TP/SL inline, optionally bind referralCode) rather than stated as when-to-use guidance. There is no explicit routing to alternatives such as build_set_tp_sl for later TP/SL edits or build_add_margin, and no stated preconditions in the description itself (the agent-authorization prerequisite lives only in the schema).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.