Skip to main content
Glama

get_strategy_status

Retrieve current grid trading strategy status including open orders, current price, and profit/loss estimates for specified exchange and trading pair.

Instructions

Get current grid strategy status: open orders, current price, and P&L estimate

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeYesExchange to query. Supported: mexc, gateio, bitget, kraken
symbolYesTrading pair symbol (e.g., BTC/USDT, INDY/USDT)

Implementation Reference

  • The complete implementation of get_strategy_status tool, including registration, schema definition (exchange and symbol parameters), and the handler logic that fetches current ticker price, open orders, calculates buy/sell spread, and returns comprehensive strategy status with order details.
    server.tool(
      'get_strategy_status',
      'Get current grid strategy status: open orders, current price, and P&L estimate',
      {
        exchange: ExchangeParam,
        symbol: SymbolParam,
      },
      async ({ exchange, symbol }) => {
        const validExchange = validateExchange(exchange);
        const validSymbol = validateSymbol(symbol);
    
        const connector = await getConnectorSafe(exchange);
        const [ticker, openOrders] = await Promise.all([
          connector.getTicker(validSymbol),
          connector.getOpenOrders(validSymbol),
        ]);
    
        const buyOrders = openOrders.filter((o: any) => o.side === 'buy');
        const sellOrders = openOrders.filter((o: any) => o.side === 'sell');
    
        const spread =
          sellOrders.length > 0 && buyOrders.length > 0
            ? Math.min(...sellOrders.map((o: any) => o.price)) -
              Math.max(...buyOrders.map((o: any) => o.price))
            : null;
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(
                {
                  currentPrice: ticker.last,
                  openOrders: {
                    total: openOrders.length,
                    buyOrders: buyOrders.length,
                    sellOrders: sellOrders.length,
                  },
                  gridSpread: spread,
                  orders: openOrders.map((o: any) => ({
                    id: o.id,
                    side: o.side,
                    price: o.price,
                    amount: o.amount,
                    filled: o.filled,
                    remaining: o.remaining,
                  })),
                  exchange: validExchange,
                  symbol: validSymbol,
                  timestamp: new Date().toISOString(),
                },
                null,
                2
              ),
            },
          ],
        };
      }
    );
  • Schema definitions for ExchangeParam and SymbolParam used by get_strategy_status for input validation.
    export const ExchangeParam = z
      .string()
      .describe('Exchange to query. Supported: mexc, gateio, bitget, kraken');
    
    export const SymbolParam = z.string().describe('Trading pair symbol (e.g., BTC/USDT, INDY/USDT)');
  • The registerStrategyTools function is imported and called to register all strategy tools including get_strategy_status.
    import { registerStrategyTools } from './strategy.js';
    
    export function registerTools(server: McpServer): void {
      registerMarketDataTools(server);
      registerAccountTools(server);
      registerTradingTools(server);
      registerCardanoTools(server);
      registerStrategyTools(server);
  • src/worker.ts:38-38 (registration)
    The get_strategy_status tool is listed in the MCP server capabilities card for discovery.
    { name: 'get_strategy_status' },
Behavior2/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. It states the tool retrieves status information, implying a read-only operation, but does not cover critical aspects like authentication requirements, rate limits, error conditions, or the format of the returned data (e.g., JSON structure). This leaves significant gaps for an agent to understand how to handle the tool effectively.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the purpose. It avoids unnecessary words, but could be slightly improved by structuring key points (e.g., listing the retrieved data more clearly) for better readability, though it remains highly concise.

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?

Given the complexity of a grid strategy tool with no annotations and no output schema, the description is incomplete. It lacks details on the return format (e.g., what 'P&L estimate' includes), error handling, and dependencies on other tools like 'start_grid_strategy'. This makes it inadequate for an agent to fully understand the tool's context and usage.

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?

Schema description coverage is 100%, so the input schema fully documents the parameters (exchange and symbol). The description adds no additional meaning beyond what the schema provides, such as explaining how the symbol relates to the grid strategy or any constraints on the exchange-symbol combination. Thus, 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 action ('Get') and the resource ('current grid strategy status'), specifying what information is retrieved (open orders, current price, P&L estimate). However, it does not explicitly differentiate from sibling tools like 'list_orders' or 'get_ticker', which might provide overlapping or related data, so it falls short of a perfect score.

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 does not mention prerequisites, such as needing an active grid strategy, or compare it to siblings like 'list_orders' for order details or 'get_ticker' for price data, leaving usage context implied at best.

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/QBT-Labs/openmm-mcp'

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