Skip to main content
Glama
gagarinyury

MCP Bitget Trading Server

by gagarinyury

getMarginInfo

Retrieve margin account details for cryptocurrency trading on Bitget, including balances and positions, to monitor risk exposure and manage leveraged positions effectively.

Instructions

Get margin account information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoFilter by symbol

Implementation Reference

  • MCP tool handler: parses arguments using GetMarginInfoSchema, calls BitgetRestClient.getMarginInfo(symbol), and returns JSON stringified result.
    case 'getMarginInfo': {
      const { symbol } = GetMarginInfoSchema.parse(args);
      const marginInfo = await this.bitgetClient.getMarginInfo(symbol);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(marginInfo, null, 2),
          },
        ],
      } as CallToolResult;
    }
  • Zod input schema for getMarginInfo tool: optional symbol parameter.
    export const GetMarginInfoSchema = z.object({
      symbol: z.string().optional().describe('Filter by symbol')
    });
  • src/server.ts:228-238 (registration)
    Tool registration in MCP server's listTools handler: defines name, description, and JSON input schema.
    {
      name: 'getMarginInfo',
      description: 'Get margin account information',
      inputSchema: {
        type: 'object',
        properties: {
          symbol: { type: 'string', description: 'Filter by symbol' }
        },
        required: []
      },
    },
  • BitgetRestClient helper method: fetches margin account details from Bitget API endpoint /api/v2/mix/account/accounts for USDT-FUTURES.
    async getMarginInfo(symbol?: string): Promise<any> {
      const params: any = { productType: 'USDT-FUTURES' };
      if (symbol) {
        // Add _UMCBL suffix for futures if not present
        params.symbol = symbol.includes('_') ? symbol : `${symbol}_UMCBL`;
      }
    
      const response = await this.request<any>('GET', '/api/v2/mix/account/accounts', params, true);
      return response.data;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Get margin account information' implies a read-only operation, but it doesn't specify what information is returned, whether authentication is required, rate limits, error conditions, or data freshness. The description provides minimal behavioral context beyond the basic operation.

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 extremely concise at just four words: 'Get margin account information'. It's front-loaded with the core purpose and contains no unnecessary words or sentences. Every word earns its place in this minimal description.

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

Completeness2/5

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

For a financial tool that presumably returns margin account data (which could include leverage, equity, margin requirements, etc.), the description is insufficient. With no annotations, no output schema, and minimal behavioral context, users cannot understand what information will be returned or how to interpret it. The description doesn't compensate for the lack of structured metadata.

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 100% description coverage, with the single parameter 'symbol' documented as 'Filter by symbol'. The description doesn't add any parameter information beyond what's already in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as 'Get margin account information', which is a clear verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'getBalance' or 'getPositions' that might also provide account-related information. The purpose is understandable but lacks differentiation from similar tools.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate, what prerequisites might exist, or how it differs from sibling tools like 'getBalance' or 'getPositions'. Users must infer usage context from the tool name alone.

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/gagarinyury/MCP-bitget-trading'

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