Skip to main content
Glama
gagarinyury

MCP Bitget Trading Server

by gagarinyury

getOrders

Retrieve current open orders from the Bitget exchange, filtered by symbol or status, to manage and monitor trading positions effectively via the MCP Bitget Trading Server.

Instructions

Get current open orders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by status
symbolNoFilter by symbol

Implementation Reference

  • MCP tool handler for 'getOrders': parses input parameters using GetOrdersSchema, calls bitgetClient.getOrders(), and returns the orders as a JSON-formatted text response.
    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 the input parameters for the getOrders tool: optional symbol and status filters.
    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)
    Registration of the 'getOrders' tool in the ListTools response, including name, description, and input schema 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 type.
    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