Skip to main content
Glama

授权 agent 交易

build_agent_authorize
Read-only

agent 专用通道:生成用户主钱包要签的授权交易,把 agent 的地址设为「只能交易、不能提币」的子账户。限定操作次数、有效天数(默认 3 天,最长 30 天)、可动用的精确 USDC 保证金上限,可选 gas 预算(合约每次按实际花费从用户 WBNB 报销给 agent)。签完后 agent 在开仓 / 平仓 / 止盈止损 / 撤单工具里带上 agent 参数,就能用自己的私钥直接下单。

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>",
      "agent": "<agent>",
      "maxActions": "<maxActions>",
      "days": "<days>",
      "usdcBudget": "<usdcBudget>",
      "gasBudgetBnb": "<gasBudgetBnb>",
      "topUpPerActionBnb": "<topUpPerActionBnb>",
      "seedAgentBnb": "<seedAgentBnb>"
    },
    "name": "build_agent_authorize"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysYes有效天数(默认 3 天,最长 30 天),到期后自动失效
agentYesagent 自己的钱包地址(agent 本地生成的新私钥对应的地址,不要用用户主钱包)
accountYes用户钱包地址(交易的签名人和收款人)
maxActionsYes本次授权可用的操作次数(下单、改单、撤单各算一次;开仓带止盈止损算 3 次)
usdcBudgetYesagent 最多能动用的 USDC 保证金(设为 Router 的精确 USDC 授权额度,与网页下单共用)
gasBudgetBnbYesgas 预算:包成 WBNB 授权给合约,每次操作后按实际花费报销给 agent;0 表示不报销,agent 自己出 gas
seedAgentBnbYesagent 钱包 BNB 少于这个数时,顺带转给它这么多,用来发第一笔交易;0 表示不转
topUpPerActionBnbYes单次操作最多报销多少 BNB

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds important context: the tool produces a transaction for the user's main wallet to sign rather than executing it, and it discloses permission limits, expiry, and gas reimbursement mechanics. It does not explain repeat-call behavior or whether a new authorization replaces a prior one, so it falls short of full behavioral disclosure.

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 description is a single dense paragraph but front-loads the purpose and key restriction. Every sentence carries useful information about permissions, limits, or post-signing usage, though slight structural separation would improve scanability.

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 an eight-parameter authorization-builder with no output schema, the description covers purpose, permission scope, key defaults, and how the signed result is used downstream. It does not describe the exact return shape or re-authorization semantics, but it is largely sufficient for an agent to invoke it 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 all eight parameters are already documented. The description reinforces a few key constraints, such as the default/maximum validity days and the reimbursement nature of the gas budget, but mostly repeats what the schema already provides rather than adding new semantic meaning.

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 uses a specific verb (生成) and resource (授权交易), and explains the resulting permission scope (只能交易、不能提币的子账户). This clearly distinguishes it from revocation or status-check siblings without needing their names.

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 this is the agent-dedicated setup path and explains the follow-up workflow: after signing, use the agent parameter in open/close/TP-SL/cancel tools. It lacks explicit exclusions such as when to use revoke or how to check existing authorization, but the primary usage context is clear.

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