Skip to main content
Glama
qeinfinity

Binance MCP Server

test_futures_endpoints

Validate Binance futures API endpoints by testing trading pair connectivity and response functionality for cryptocurrency market data integration.

Instructions

Test individual futures endpoints

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesTrading pair symbol (e.g., BTCUSDT)

Implementation Reference

  • Main handler logic for the 'test_futures_endpoints' tool. Validates input parameters and fetches data from three futures endpoints (open interest, funding rate, liquidations) using the BinanceRestConnector, then returns the combined results as JSON.
    case "test_futures_endpoints": {
      if (!isFuturesDataParams(request.params.arguments)) {
        throw new Error('Invalid futures data parameters');
      }
      const { symbol } = request.params.arguments;
      
      // Test each endpoint individually
      const openInterest = await restConnector.getFuturesOpenInterest(symbol);
      const fundingRate = await restConnector.getFuturesFundingRate(symbol);
      const liquidations = await restConnector.getFuturesLiquidations(symbol);
    
      // Return all test results
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            openInterest,
            fundingRate,
            liquidations
          }, null, 2)
        }]
      };
    }
  • src/index.ts:66-79 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema requiring a 'symbol' string.
    {
      name: "test_futures_endpoints",
      description: "Test individual futures endpoints",
      inputSchema: {
        type: "object",
        properties: {
          symbol: { 
            type: "string", 
            description: "Trading pair symbol (e.g., BTCUSDT)" 
          }
        },
        required: ["symbol"]
      }
    },
  • Helper method called by the tool handler to fetch futures open interest data from Binance API endpoint '/futures/v1/openInterest'.
    public async getFuturesOpenInterest(symbol: string): Promise<any> {
      try {
        logger.info(`Getting futures open interest for ${symbol}`);
        const response = await this.executeWithRetry(() =>
          this.axiosInstance.get(`${config.FUTURES_REST_URL}/openInterest`, {
            params: { symbol: symbol.toUpperCase() }
          })
        );
        logger.info('Successfully fetched open interest data');
        return response.data;
      } catch (error) {
        logger.error('Error fetching open interest:', error);
        throw new APIError('Failed to fetch open interest data', error as Error);
      }
    }
  • Helper method called by the tool handler to fetch futures funding rate (premium index) from Binance API endpoint '/futures/v1/premiumIndex'.
    public async getFuturesFundingRate(symbol: string): Promise<any> {
      try {
        logger.info(`Getting futures funding rate for ${symbol}`);
        const response = await this.executeWithRetry(() =>
          this.axiosInstance.get(`${config.FUTURES_REST_URL}/premiumIndex`, {
            params: {
              symbol: symbol.toUpperCase()
            }
          })
        );
        logger.info('Successfully fetched funding rate data');
        return response.data;
      } catch (error) {
        logger.error('Error fetching funding rate:', error);
        throw new APIError('Failed to fetch funding rate data', error as Error);
      }
    }
  • Helper method called by the tool handler to fetch recent futures liquidations (force orders) from Binance API endpoint '/futures/v1/forceOrders' for the last 24 hours.
    public async getFuturesLiquidations(symbol: string): Promise<any> {
      try {
        logger.info(`Getting futures liquidations for ${symbol}`);
        const response = await this.executeWithRetry(() =>
          this.axiosInstance.get(`${config.FUTURES_REST_URL}/forceOrders`, {
            params: {
              symbol: symbol.toUpperCase(),
              startTime: Date.now() - 24 * 60 * 60 * 1000,
              limit: 1000
            }
          })
        );
        logger.info('Successfully fetched liquidations data');
        return response.data;
      } catch (error) {
        logger.error('Error fetching liquidations:', error);
        throw new APIError('Failed to fetch liquidations data', error as Error);
      }
    }
Behavior1/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 but fails to do so. It doesn't indicate whether this is a read/write operation, what it returns, any side effects (e.g., rate limits, authentication needs), or how it interacts with the system. The vague term 'test' offers no actionable behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, vague phrase that is under-specified rather than concise. It lacks front-loaded clarity and fails to earn its place by providing meaningful information. While brief, it doesn't achieve conciseness through efficiency but through omission of essential details.

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

Completeness1/5

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

Given the tool's complexity (implied by 'test' and futures endpoints), lack of annotations, and no output schema, the description is completely inadequate. It doesn't explain what 'test' entails, what results to expect, or how it fits with sibling tools, leaving significant gaps for an AI agent to understand and use the tool correctly.

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 adds no parameter semantics beyond what the input schema provides. Since schema description coverage is 100% (the 'symbol' parameter is documented as 'Trading pair symbol (e.g., BTCUSDT)'), the baseline score is 3. The description doesn't clarify usage, constraints, or examples related to the parameter.

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

Purpose2/5

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

The description 'Test individual futures endpoints' is a tautology that essentially restates the tool name 'test_futures_endpoints' without specifying what action is performed. It doesn't identify a specific verb (e.g., validate, ping, verify) or resource (e.g., API endpoints, connectivity), making the purpose vague and indistinguishable from sibling tools like 'get_futures_funding_rate' or 'get_klines'.

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

Usage Guidelines1/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, nor does it reference sibling tools like 'get_market_data' or 'subscribe_market_data' that might serve similar purposes. This leaves the agent with no information to make an informed selection.

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/qeinfinity/binance-mcp-server'

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