Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

setMarginMode

Change your Bybit account margin mode to isolated, regular, or portfolio. Returns failure reasons if the mode cannot be set.

Instructions

Set the account margin mode. Supports ISOLATED_MARGIN, REGULAR_MARGIN, and PORTFOLIO_MARGIN. Returns failure reasons if the mode cannot be set.

Rate limit: 5 req/s

Agent hint: Use this to change the account's margin mode. The setMarginMode field is required. Check the result.reasons array for failure details. Portfolio margin typically requires a minimum equity threshold (e.g., 1000 USDC). Use getAccountInfo first to check the current mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
setMarginModeYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the rate limit (5 req/s), that it returns failure reasons, and that portfolio margin has a minimum equity requirement. It could mention idempotency or effects on existing positions, but the provided info is solid.

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 very concise with four sentences covering purpose, parameters, rate limit, and hints. No wasted words; everything is front-loaded and relevant.

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?

For a simple tool with one parameter and no output schema, the description covers all key aspects: what it does, what modes are available, rate limit, failure handling, and prerequisites (portfolio min equity). It is complete for effective use.

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

Parameters2/5

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

The single parameter setMarginMode is well-covered by the schema (enum with three options). However, the description only repeats that it's required and does not add any additional meaning about what each mode implies (e.g., risk profiles, eligibility). With 0% schema description coverage, the description should compensate, but it doesn't.

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 the tool sets the account margin mode and lists the three supported modes (ISOLATED_MARGIN, REGULAR_MARGIN, PORTFOLIO_MARGIN). It distinguishes itself from sibling tools like setLeverage and setHedgingMode by focusing specifically on margin mode.

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 explicitly states when to use the tool ('to change the account's margin mode') and provides actionable hints: check result.reasons for failures, note portfolio margin requires equity threshold, and suggests calling getAccountInfo first to check current mode. This covers both when and when-not to use.

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