Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

setLeverage

Adjust contract position leverage for linear or inverse contracts. Set buy and sell leverage values; ensure they match for one-way or cross margin, but they can differ in isolated hedge mode.

Instructions

Set the leverage for a contract position. Supports linear and inverse contracts. In one-way mode or cross margin mode, buyLeverage and sellLeverage must be equal. In isolated margin hedge mode, they can differ.

Agent hint: Use this to change leverage on an existing or new position. Always set both buyLeverage and sellLeverage. For one-way mode and cross margin, they must be identical. Do not set leverage to the current value or it will error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
categoryYes
buyLeverageYes
sellLeverageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.11

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already indicate this is a non-read-only, non-destructive mutation. The description adds important behavioral details: both leverage values must be set, equality is required in certain modes, and setting the current value will cause an error. No contradiction with annotations.

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 purpose is front-loaded in the first sentence, and the agent hint is practical. Some redundancy exists: the one-way/cross margin equality rule is effectively stated twice.

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 simple configuration tool, the description covers the main constraints, mode behavior, and a known error condition. It does not cover all possible edge cases or output semantics, but gives enough for an agent to invoke it correctly in common scenarios.

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 0%, so the description must compensate. It clarifies buyLeverage and sellLeverage through mode constraints and category through 'linear and inverse contracts.' However, it does not explain the expected value format, valid ranges, or how symbol is specified.

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 specific verb ('Set') and resource ('leverage for a contract position'), and it explicitly mentions linear and inverse contracts. This clearly differentiates it from related tools like spotMarginSetLeverage by focusing on contract 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 agent hint gives clear when-to-use guidance: 'Use this to change leverage on an existing or new position.' It also provides mode-specific rules for one-way, cross, and isolated hedge modes. However, it does not explicitly name alternatives 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.

Install Server

Other Tools