Skip to main content
Glama

place-futures-market-order

Execute a futures market order on supported cryptocurrency exchanges. Specify exchange, trading pair, side, amount, and authentication details to place buy or sell orders directly through the CCXT MCP Server.

Instructions

Place a futures market order

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount to buy/sell
apiKeyYesAPI key for authentication
exchangeYesExchange ID (e.g., binance, bybit)
marketTypeNoMarket type (default: future)future
paramsNoAdditional order parameters
passphraseNoPassphrase for authentication (required for some exchanges like KuCoin)
secretYesAPI secret for authentication
sideYesOrder side: buy or sell
symbolYesTrading pair symbol (e.g., BTC/USDT)

Implementation Reference

  • The main handler function for the 'place-futures-market-order' tool. It retrieves the exchange instance with credentials, logs the action, places a market order using ex.createOrder, and returns the order details or error.
    }, async ({ exchange, symbol, side, amount, params, apiKey, secret, passphrase, marketType }) => {
      try {
        return await rateLimiter.execute(exchange, async () => {
          // Get futures exchange
          const ex = getExchangeWithCredentials(exchange, apiKey, secret, marketType, passphrase);
          
          // Place futures market order
          log(LogLevel.INFO, `Placing futures ${side} market order for ${symbol} on ${exchange} (${marketType}), amount: ${amount}`);
          const order = await ex.createOrder(symbol, 'market', side, amount, undefined, params || {});
          
          return {
            content: [{
              type: "text",
              text: JSON.stringify(order, null, 2)
            }]
          };
        });
      } catch (error) {
        log(LogLevel.ERROR, `Error placing futures market order: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    });
  • Zod schema defining the input parameters for the tool, including exchange, symbol, side, amount, optional params and passphrase, API credentials, and marketType.
    exchange: z.string().describe("Exchange ID (e.g., binance, bybit)"),
    symbol: z.string().describe("Trading pair symbol (e.g., BTC/USDT)"),
    side: z.enum(['buy', 'sell']).describe("Order side: buy or sell"),
    amount: z.number().positive().describe("Amount to buy/sell"),
    params: z.record(z.any()).optional().describe("Additional order parameters"),
    apiKey: z.string().describe("API key for authentication"),
    secret: z.string().describe("API secret for authentication"),
    passphrase: z.string().optional().describe("Passphrase for authentication (required for some exchanges like KuCoin)"),
    marketType: z.enum(["future", "swap"]).default("future").describe("Market type (default: future)")
  • The server.tool call that registers the 'place-futures-market-order' tool with its name, description, input schema, and handler function.
    server.tool("place-futures-market-order", "Place a futures market order", {
      exchange: z.string().describe("Exchange ID (e.g., binance, bybit)"),
      symbol: z.string().describe("Trading pair symbol (e.g., BTC/USDT)"),
      side: z.enum(['buy', 'sell']).describe("Order side: buy or sell"),
      amount: z.number().positive().describe("Amount to buy/sell"),
      params: z.record(z.any()).optional().describe("Additional order parameters"),
      apiKey: z.string().describe("API key for authentication"),
      secret: z.string().describe("API secret for authentication"),
      passphrase: z.string().optional().describe("Passphrase for authentication (required for some exchanges like KuCoin)"),
      marketType: z.enum(["future", "swap"]).default("future").describe("Market type (default: future)")
    }, async ({ exchange, symbol, side, amount, params, apiKey, secret, passphrase, marketType }) => {
      try {
        return await rateLimiter.execute(exchange, async () => {
          // Get futures exchange
          const ex = getExchangeWithCredentials(exchange, apiKey, secret, marketType, passphrase);
          
          // Place futures market order
          log(LogLevel.INFO, `Placing futures ${side} market order for ${symbol} on ${exchange} (${marketType}), amount: ${amount}`);
          const order = await ex.createOrder(symbol, 'market', side, amount, undefined, params || {});
          
          return {
            content: [{
              type: "text",
              text: JSON.stringify(order, null, 2)
            }]
          };
        });
      } catch (error) {
        log(LogLevel.ERROR, `Error placing futures market order: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states it 'places' an order (implying a write/mutation operation) but doesn't mention authentication requirements (though parameters suggest them), rate limits, order execution behavior, error conditions, or what happens on success/failure. For a financial trading tool with significant implications, this is inadequate.

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 maximally concise at just 4 words - 'Place a futures market order.' It's front-loaded with the essential action and resource, with zero wasted words or unnecessary elaboration. This is an example of efficient communication when the schema provides detailed parameter documentation.

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 complex financial trading tool with 9 parameters (including authentication credentials), no annotations, and no output schema, the description is severely incomplete. It doesn't explain what constitutes success/failure, return values, error handling, authentication requirements, or how this differs from sibling tools. The schema handles parameters well, but the overall context for safe and correct usage is missing.

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?

With 100% schema description coverage, the schema already documents all 9 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. The baseline score of 3 reflects adequate parameter documentation entirely through the schema, though the description contributes nothing extra.

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 action ('place') and resource ('futures market order'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'place-market-order' - the only distinction appears to be 'futures' vs unspecified market type, but this isn't explicitly explained.

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. With sibling tools like 'place-market-order' and 'set-market-type' available, there's no indication of when this futures-specific tool is appropriate versus using the more generic market order tool with market type configuration.

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

Related 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/doggybee/mcp-server-ccxt'

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