Skip to main content
Glama
gagarinyury

MCP Bitget Trading Server

by gagarinyury

getOrders

Retrieve current open orders from Bitget exchange to monitor trading positions, filter by symbol or status for order management.

Instructions

Get current open orders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoFilter by symbol
statusNoFilter by status

Implementation Reference

  • MCP tool handler for 'getOrders': parses input parameters using GetOrdersSchema, calls bitgetClient.getOrders(), and returns JSON-formatted orders.
    case 'getOrders': { const { symbol, status } = GetOrdersSchema.parse(args); const orders = await this.bitgetClient.getOrders(symbol, status); return { content: [ { type: 'text', text: JSON.stringify(orders, null, 2), }, ], } as CallToolResult; }
  • Zod schema defining optional input parameters 'symbol' and 'status' for the getOrders tool.
    export const GetOrdersSchema = z.object({ symbol: z.string().optional().describe('Filter by symbol'), status: z.enum(['open', 'filled', 'cancelled']).optional().describe('Filter by status') });
  • src/server.ts:193-204 (registration)
    Registers the 'getOrders' tool in the MCP server's listTools response with name, description, and input schema (hardcoded matching the Zod schema).
    { name: 'getOrders', description: 'Get current open orders', inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: 'Filter by symbol' }, status: { type: 'string', enum: ['open', 'filled', 'cancelled'], description: 'Filter by status' } }, required: [] }, },
  • Core implementation of getOrders in BitgetRestClient: dispatches to spot or futures order fetching based on symbol, which is called by the MCP handler.
    async getOrders(symbol?: string, status?: string): Promise<Order[]> { if (symbol && this.isFuturesSymbol(symbol)) { return this.getFuturesOrders(symbol, status); } else { return this.getSpotOrders(symbol, status); } }

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