Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

setLeverage

Adjust leverage for both buy and sell sides of a contract position. Supports linear and inverse contracts with margin mode constraints.

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
categoryYes
symbolYes
buyLeverageYes
sellLeverageYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that setting to current value causes an error and explains the equality constraint between buyLeverage and sellLeverage depending on margin mode. However, it does not describe potential side effects like impact on existing orders or permissions needed.

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

Conciseness5/5

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

The description is concise, with no wasted words. It starts with the core purpose, then conditions, then an agent hint in a logical order. Every sentence adds value.

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?

Given the tool has 4 required parameters, one enum, and no output schema, the description covers the main behavior and constraints well. However, it does not mention what the response looks like (e.g., success indication) or any prerequisites like having the contract already, which would improve completeness.

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?

The input schema has 0% description coverage, so the description must compensate. It explains the role of buyLeverage and sellLeverage and their constraints, but does not specify the expected format (e.g., numeric string, decimal places) for leverage values, leaving ambiguity.

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 'Set the leverage for a contract position' and specifies supported contract types (linear and inverse), providing a specific verb and resource that distinguishes it from sibling tools like setMarginMode or setHedgingMode.

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?

The description provides explicit when-to-use guidance with mode-specific rules (one-way/cross vs isolated hedge) and a direct agent hint explaining how to use both parameters correctly and warning against setting leverage to the current value, which would cause an error.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bybit-exchange/trading-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server