Skip to main content
Glama
Bybit MCP Server

Bybit MCP Server

Official

setTradeAutoRepay

Enable or disable trade auto repayment for an authenticated Unified account, letting eligible spot trade credits repay their own flexible-rate liability in Cross or Portfolio margin mode.

Instructions

Enable (autoRepay="1") or disable (autoRepay="0") trade auto repayment for the authenticated Unified account. Requires explicit client approval. When enabled, a coin credited by an eligible spot trade can repay its own flexible-rate liability without asset conversion; the amount depends on the trade credit, available balance, and outstanding liability. This account-wide switch is disabled by default and separate from scheduled auto repayment configured by setAutoRepayMode. Repayment runs only in Cross and Portfolio margin modes. Isolated accounts can save the setting, but no trade auto repayment runs while they remain in Isolated mode. A successful response reports the saved switch in result.autoRepay, not a completed repayment. autoRepay must be the string "0" or "1"; 34022101 means invalid autoRepay. Locally limited to 5 requests per rolling second per path within one MCP process. Business failures surface as MCP tool errors.

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": {
      "autoRepay": "<autoRepay>"
    },
    "name": "setTradeAutoRepay"
  }
}

Input Schema

NameRequiredDescriptionDefault
autoRepayYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.28

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnly=false, destructive=false, openWorld=true) by disclosing the default-off state, the account-wide scope, that the response reports a saved switch in result.autoRepay rather than a completed repayment, the error code 34022101 for an invalid value, a 5-requests-per-rolling-second per-path local limit, and how business failures surface. These are exactly the operational facts an agent needs and none are derivable from structured fields.

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?

Front-loaded with the verb and the value mapping, then progressively narrower caveats; every sentence is substantive. The one redundant clause is the restatement that autoRepay must be "0" or "1", which the enum already enforces, though the attached error code still earns its place.

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

Completeness5/5

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

No output schema exists, and the description compensates by describing exactly what a successful response contains (result.autoRepay as the saved switch) and how failures appear. For a single-parameter, side-effecting switch with margin-mode caveats and a rate limit, nothing an agent needs to invoke it correctly is missing.

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

Parameters5/5

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

Schema coverage is 0% and the enum only gives the raw values, so the description carries the semantic load: it explains that "1" enables and "0" disables, that the value must be the string form, and what enabling actually causes (a credited coin repaying its own flexible-rate liability without conversion, sized by trade credit, available balance, and outstanding liability).

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?

Opens with a specific verb pair (enable/disable) applied to a named resource (trade auto repayment) scoped to the authenticated Unified account, and explicitly distinguishes itself from the similarly named sibling setAutoRepayMode. An agent can tell the two apart without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States when the switch takes effect (Cross and Portfolio margin only), the explicit when-not (no repayment runs while the account stays in Isolated mode, though the setting is saved), and names the alternative mechanism (scheduled auto repayment via setAutoRepayMode). It also flags the prerequisite of explicit client approval.

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

Deploy Server

Other Tools