Skip to main content
Glama

Build Manage Transaction

build_manage_tx

Build the UNSIGNED transaction to adjust or close an OPEN position, for the given wallet to sign. Non-custodial (never signs/holds keys). Canonical output is the executable { approvals[], tx{to,data,value} } (sign/broadcast directly); meta.signingUrl is an optional link for a human to sign in their own wallet. Actions: 'close' (unwind fully), 'increase_leverage' (borrow to a higher LTV), 'add_collateral' (top up — pay in collateral or any token), 'remove_collateral' (withdraw), 'repay' (pay down debt; set full=true to clear it), 'borrow' (draw more loan token). Get the position id from get_positions. Swap calldata (close/increase/zap paths) is time-sensitive — see meta.expiresAt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesOn-chain position index, from get_positions (its `id`).
fullNorepay only: clear the entire remaining debt.
actionYesWhat to do to the position.
amountNoHuman-units amount. Required for add_collateral/remove_collateral/repay/borrow.
chainIdNoChain to target. Supported: 1, 4663. Default: 1.
leverageNoincrease_leverage: target leverage. Provide this OR desiredLtv.
payTokenNoToken to pay in (add_collateral/repay). Collateral/loan = direct; any other = zapped. ETH = zero address.
slippageNoSwap slippage ratio (0.005 = 0.5%). Default 0.005, capped at 0.01.
desiredLtvNoincrease_leverage: target LTV percent (e.g. '80'). Provide this OR leverage.
userAddressYesWallet that owns the position and will sign.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations provide readOnlyHint=false and destructiveHint=false. The description adds that the tool is non-custodial and never signs/holds keys, and mentions the output structure and optional signing URL. It also notes time-sensitivity via meta.expiresAt, providing useful behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is thorough but somewhat lengthy. It is well-structured with important information front-loaded, but contains more detail than necessary, reducing conciseness.

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?

Given 10 parameters, no output schema, and complex actions, the description covers actions, parameters, and prerequisites. However, it lacks a detailed explanation of the output format (besides mentioning canonical output), leaving some ambiguity for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline 3. The description adds meaning by explaining each action's purpose, the role of amount for certain actions, details about payToken (zapping behavior), and slippage meaning. This adds value beyond the schema descriptions.

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 clearly states that the tool builds unsigned transactions to adjust or close open positions. It lists specific actions (close, increase_leverage, etc.) and distinguishes itself from sibling tools like build_leverage_tx by focusing on managing existing positions.

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?

The description provides clear context on when to use each action and directs users to get the position id from get_positions. However, it does not explicitly compare with sibling tools or state when not to use this tool.

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.

TDQS

A4.3/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: building opening vs. managing transactions, reading positions, getting prices, listing/querying strategies, and simulating. No overlapping or ambiguous functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores (e.g., build_leverage_tx, get_positions, list_strategies). The naming is predictable and uniform.

Tool Count5/5

7 tools is well-scoped for the domain of non-custodial leverage positions. It covers all essential operations without being too few or excessive.

Completeness5/5

The tool set covers the full lifecycle: preview (simulate), open (build_leverage_tx), manage (build_manage_tx with close/adjust actions), read positions, and explore strategies/prices. No obvious gaps for the intended purpose.