Skip to main content
Glama
questflowai

Aster Finance MCP Server

by questflowai

ticker_bookTicker

Get the best bid and ask prices with quantities for cryptocurrency trading symbols to monitor real-time order book liquidity and market depth.

Instructions

Best price/qty on the order book for a symbol or symbols.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoTrading symbol

Implementation Reference

  • Handler for the 'ticker_bookTicker' tool. Dispatches a GET request to the Aster Futures API endpoint '/fapi/v1/ticker/bookTicker' using the shared makeRequest utility, with optional 'symbol' argument.
    case 'ticker_bookTicker':
      return makeRequest('GET', '/fapi/v1/ticker/bookTicker', args);
  • Tool registration including name, description, and input schema definition for 'ticker_bookTicker'. Input schema allows optional 'symbol' parameter.
    {
      name: 'ticker_bookTicker',
      description: 'Best price/qty on the order book for a symbol or symbols.',
      inputSchema: {
        type: 'object',
        properties: {
          symbol: { type: 'string', description: 'Trading symbol' },
        },
      },
    },
  • src/index.ts:48-537 (registration)
    The ListToolsRequestSchema handler registers all available tools, including 'ticker_bookTicker', by returning the tools array with their schemas.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          // Market Data
          { name: 'ping', description: 'Test connectivity to the Rest API.', inputSchema: { type: 'object', properties: {} } },
          { name: 'time', description: 'Get the current server time.', inputSchema: { type: 'object', properties: {} } },
          { name: 'exchangeInfo', description: 'Get current exchange trading rules and symbol information.', inputSchema: { type: 'object', properties: {} } },
          {
            name: 'depth',
            description: 'Get the order book for a symbol.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol, e.g., BTCUSDT' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1000.' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'trades',
            description: 'Get recent market trades.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1000.' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'historicalTrades',
            description: 'Get older market historical trades.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1000.' },
                fromId: { type: 'number', description: 'TradeId to fetch from.' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'aggTrades',
            description: 'Get compressed, aggregate market trades.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
                fromId: { type: 'number', description: 'ID to get aggregate trades from INCLUSIVE.' },
                startTime: { type: 'number', description: 'Timestamp in ms to get aggregate trades from INCLUSIVE.' },
                endTime: { type: 'number', description: 'Timestamp in ms to get aggregate trades until INCLUSIVE.' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1000.' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'klines',
            description: 'Get Kline/candlestick bars for a symbol.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
                interval: { type: 'string', description: 'Kline interval (e.g., 1m, 5m, 1h, 1d)' },
                startTime: { type: 'number', description: 'Start time in ms' },
                endTime: { type: 'number', description: 'End time in ms' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1500.' },
              },
              required: ['symbol', 'interval'],
            },
          },
          {
            name: 'indexPriceKlines',
            description: 'Kline/candlestick bars for the index price of a pair.',
            inputSchema: {
              type: 'object',
              properties: {
                pair: { type: 'string', description: 'Trading pair, e.g., BTCUSDT' },
                interval: { type: 'string', description: 'Kline interval' },
                startTime: { type: 'number', description: 'Start time in ms' },
                endTime: { type: 'number', description: 'End time in ms' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1500.' },
              },
              required: ['pair', 'interval'],
            },
          },
          {
            name: 'markPriceKlines',
            description: 'Kline/candlestick bars for the mark price of a symbol.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
                interval: { type: 'string', description: 'Kline interval' },
                startTime: { type: 'number', description: 'Start time in ms' },
                endTime: { type: 'number', description: 'End time in ms' },
                limit: { type: 'number', description: 'Number of results. Default 500, max 1500.' },
              },
              required: ['symbol', 'interval'],
            },
          },
          {
            name: 'premiumIndex',
            description: 'Get Mark Price and Funding Rate.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
              },
            },
          },
          {
            name: 'fundingRate',
            description: 'Get funding rate history.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
                startTime: { type: 'number', description: 'Start time in ms' },
                endTime: { type: 'number', description: 'End time in ms' },
                limit: { type: 'number', description: 'Number of results. Default 100, max 1000.' },
              },
            },
          },
          {
            name: 'fundingInfo',
            description: 'Get funding rate config.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
              },
            },
          },
          {
            name: 'ticker_24hr',
            description: '24 hour rolling window price change statistics.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
              },
            },
          },
          {
            name: 'ticker_price',
            description: 'Latest price for a symbol or symbols.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
              },
            },
          },
          {
            name: 'ticker_bookTicker',
            description: 'Best price/qty on the order book for a symbol or symbols.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string', description: 'Trading symbol' },
              },
            },
          },
          // Account/Trades
          {
            name: 'setPositionMode',
            description: "Change user's position mode (Hedge Mode or One-way Mode).",
            inputSchema: {
              type: 'object',
              properties: {
                dualSidePosition: { type: 'string', description: '"true" for Hedge Mode; "false" for One-way Mode' },
              },
              required: ['dualSidePosition'],
            },
          },
          { name: 'getPositionMode', description: "Get user's position mode.", inputSchema: { type: 'object', properties: {} } },
          {
            name: 'setMultiAssetsMode',
            description: "Change user's Multi-Assets mode.",
            inputSchema: {
              type: 'object',
              properties: {
                multiAssetsMargin: { type: 'string', description: '"true" for Multi-Assets Mode; "false" for Single-Asset Mode' },
              },
              required: ['multiAssetsMargin'],
            },
          },
          { name: 'getMultiAssetsMode', description: "Get user's Multi-Assets mode.", inputSchema: { type: 'object', properties: {} } },
          {
            name: 'placeOrder',
            description: 'Send in a new order.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                side: { type: 'string', enum: ['BUY', 'SELL'] },
                positionSide: { type: 'string', enum: ['BOTH', 'LONG', 'SHORT'] },
                type: { type: 'string', enum: ['LIMIT', 'MARKET', 'STOP', 'STOP_MARKET', 'TAKE_PROFIT', 'TAKE_PROFIT_MARKET', 'TRAILING_STOP_MARKET'] },
                timeInForce: { type: 'string', enum: ['GTC', 'IOC', 'FOK', 'GTX'] },
                quantity: { type: 'number' },
                price: { type: 'number' },
                stopPrice: { type: 'number' },
              },
              required: ['symbol', 'side', 'type'],
            },
          },
          {
            name: 'placeBatchOrders',
            description: 'Place multiple orders.',
            inputSchema: {
              type: 'object',
              properties: {
                batchOrders: {
                  type: 'array',
                  items: {
                    type: 'object',
                    properties: {
                      symbol: { type: 'string' },
                      side: { type: 'string', enum: ['BUY', 'SELL'] },
                      type: { type: 'string' },
                      quantity: { type: 'number' },
                      price: { type: 'number' },
                    },
                    required: ['symbol', 'side', 'type', 'quantity'],
                  },
                },
              },
              required: ['batchOrders'],
            },
          },
          {
            name: 'transferAsset',
            description: 'Transfer between futures and spot.',
            inputSchema: {
              type: 'object',
              properties: {
                asset: { type: 'string' },
                amount: { type: 'number' },
                clientTranId: { type: 'string' },
                kindType: { type: 'string', enum: ['FUTURE_SPOT', 'SPOT_FUTURE'] },
              },
              required: ['asset', 'amount', 'clientTranId', 'kindType'],
            },
          },
          {
            name: 'queryOrder',
            description: "Check an order's status.",
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                orderId: { type: 'number' },
                origClientOrderId: { type: 'string' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'cancelOrder',
            description: 'Cancel an active order.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                orderId: { type: 'number' },
                origClientOrderId: { type: 'string' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'cancelAllOpenOrders',
            description: 'Cancel all open orders on a symbol.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'cancelBatchOrders',
            description: 'Cancel multiple orders.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                orderIdList: { type: 'array', items: { type: 'number' } },
                origClientOrderIdList: { type: 'array', items: { type: 'string' } },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'countdownCancelAll',
            description: 'Auto-cancel all open orders.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                countdownTime: { type: 'number', description: 'Countdown time in milliseconds.' },
              },
              required: ['symbol', 'countdownTime'],
            },
          },
          {
            name: 'queryOpenOrder',
            description: 'Query current open order.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                orderId: { type: 'number' },
                origClientOrderId: { type: 'string' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'getAllOpenOrders',
            description: 'Get all open orders on a symbol.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
              },
            },
          },
          {
            name: 'getAllOrders',
            description: 'Get all account orders; active, canceled, or filled.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                orderId: { type: 'number' },
                startTime: { type: 'number' },
                endTime: { type: 'number' },
                limit: { type: 'number' },
              },
              required: ['symbol'],
            },
          },
          { name: 'getBalance', description: 'Get futures account balance.', inputSchema: { type: 'object', properties: {} } },
          { name: 'getAccountInfo', description: 'Get current account information.', inputSchema: { type: 'object', properties: {} } },
          {
            name: 'setLeverage',
            description: "Change user's initial leverage.",
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                leverage: { type: 'number', minimum: 1, maximum: 125 },
              },
              required: ['symbol', 'leverage'],
            },
          },
          {
            name: 'setMarginType',
            description: 'Change margin type.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                marginType: { type: 'string', enum: ['ISOLATED', 'CROSSED'] },
              },
              required: ['symbol', 'marginType'],
            },
          },
          {
            name: 'modifyPositionMargin',
            description: 'Modify isolated position margin.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                positionSide: { type: 'string', enum: ['BOTH', 'LONG', 'SHORT'] },
                amount: { type: 'number' },
                type: { type: 'number', enum: [1, 2], description: '1: Add, 2: Reduce' },
              },
              required: ['symbol', 'amount', 'type'],
            },
          },
          {
            name: 'getPositionMarginHistory',
            description: 'Get position margin change history.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                type: { type: 'number', enum: [1, 2] },
                startTime: { type: 'number' },
                endTime: { type: 'number' },
                limit: { type: 'number' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'getPositionInfo',
            description: 'Get current position information.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
              },
            },
          },
          {
            name: 'getTradeList',
            description: 'Get trades for a specific account and symbol.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                startTime: { type: 'number' },
                endTime: { type: 'number' },
                fromId: { type: 'number' },
                limit: { type: 'number' },
              },
              required: ['symbol'],
            },
          },
          {
            name: 'getIncomeHistory',
            description: 'Get income history.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                incomeType: { type: 'string' },
                startTime: { type: 'number' },
                endTime: { type: 'number' },
                limit: { type: 'number' },
              },
            },
          },
          {
            name: 'getLeverageBrackets',
            description: 'Get notional and leverage brackets.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
              },
            },
          },
          {
            name: 'getAdlQuantile',
            description: 'Get Position ADL Quantile Estimation.',
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
              },
            },
          },
          {
            name: 'getForceOrders',
            description: "Get user's force orders.",
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
                autoCloseType: { type: 'string', enum: ['LIQUIDATION', 'ADL'] },
                startTime: { type: 'number' },
                endTime: { type: 'number' },
                limit: { type: 'number' },
              },
            },
          },
          {
            name: 'getCommissionRate',
            description: "Get user's commission rate.",
            inputSchema: {
              type: 'object',
              properties: {
                symbol: { type: 'string' },
              },
              required: ['symbol'],
            },
          },
        ],
      };
    });
  • Shared helper function 'makeRequest' used by all tool handlers, including 'ticker_bookTicker', to make authenticated HTTP requests to the Aster API.
    const makeRequest = async (method: 'GET' | 'POST' | 'DELETE', path: string, params: any, isSigned = false) => {
      try {
        let config: any = {
          method,
          url: path,
        };
    
        if (isSigned) {
          if (!API_KEY || !API_SECRET) {
            throw new McpError(ErrorCode.InvalidRequest, 'API_KEY and API_SECRET must be configured.');
          }
          params.timestamp = Date.now();
          const queryString = new URLSearchParams(params).toString();
          const signature = crypto.createHmac('sha256', API_SECRET).update(queryString).digest('hex');
          params.signature = signature;
          
          config.headers = { 'X-MBX-APIKEY': API_KEY };
        }
        
        if (method === 'GET' || method === 'DELETE') {
          config.params = params;
        } else { // POST
          config.data = new URLSearchParams(params).toString();
          config.headers = { ...config.headers, 'Content-Type': 'application/x-www-form-urlencoded' };
        }
    
        const response = await this.axiosInstance.request(config);
        return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new McpError(
            ErrorCode.InternalError,
            `Aster API error: ${error.response?.data?.msg || error.message}`
          );
        }
        throw error;
      }
    };
Behavior2/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 of behavioral disclosure. It states the tool retrieves best price/quantity, implying a read-only operation, but doesn't specify whether it's real-time or cached, any rate limits, authentication requirements, or error conditions. For a financial data tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's front-loaded with the core functionality, making it easy to parse quickly. Every word earns its place, and there's no wasted verbiage.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It explains what the tool returns but lacks details on behavior, usage context, or output format. In a server with many trading tools, more guidance would help, but for a simple query tool, it's passable though not comprehensive.

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 description mentions 'a symbol or symbols,' which aligns with the single 'symbol' parameter in the input schema. Since schema description coverage is 100% (the parameter is well-documented as 'Trading symbol'), the description adds minimal value beyond the schema. It doesn't provide additional details like format examples or multi-symbol handling, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose: retrieving 'Best price/qty on the order book for a symbol or symbols.' It specifies the action (retrieving best price/quantity) and resource (order book for symbols), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'depth' (which might provide full order book depth) or 'ticker_price' (which might give current price without quantity), so it misses full sibling distinction.

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 any context, prerequisites, or exclusions, such as when to prefer 'depth' for full order book data or 'ticker_price' for price-only information. With many sibling tools in this trading context, the lack of usage guidelines leaves the agent to guess based on tool names 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/questflowai/aster-mcp-server'

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