Skip to main content
Glama
kongyo2

eve-online-mcp

get-market-orders

Retrieve market orders for specific items or regions in EVE Online. Filter by buy, sell, or all orders to access real-time market data through the ESI API.

Instructions

Get market orders from a specific region

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_typeNoType of orders to retrieveall
region_idYesRegion ID to get market orders from
type_idNoItem type ID to filter orders

Implementation Reference

  • The main handler function for the 'get-market-orders' tool. It constructs the ESI API endpoint for market orders in the specified region, optionally appends type_id filter, fetches the orders using makeESIRequest, filters by order_type (buy/sell/all), and returns the result as JSON text content.
      async ({ region_id, type_id, order_type }) => {
        let endpoint = `/markets/${region_id}/orders/`;
        if (type_id) {
          endpoint += `?type_id=${type_id}`;
        }
    
        const orders = await makeESIRequest<Array<MarketOrder>>(endpoint);
    
        const filteredOrders = orders.filter((order) => {
          if (order_type === "buy") return order.is_buy_order;
          if (order_type === "sell") return !order.is_buy_order;
          return true;
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(filteredOrders, null, 2),
            },
          ],
        };
      }
    );
  • Zod input schema defining parameters for the tool: region_id (required number), type_id (optional number), order_type (enum ["buy","sell","all"] with default "all".
    {
      region_id: z.number().describe("Region ID to get market orders from"),
      type_id: z.number().optional().describe("Item type ID to filter orders"),
      order_type: z
        .enum(["buy", "sell", "all"])
        .default("all")
        .describe("Type of orders to retrieve"),
    },
  • src/index.ts:287-321 (registration)
    Registration of the 'get-market-orders' tool on the MCP server, including name, description, input schema, and inline handler function.
    server.tool(
      "get-market-orders",
      "Get market orders from a specific region",
      {
        region_id: z.number().describe("Region ID to get market orders from"),
        type_id: z.number().optional().describe("Item type ID to filter orders"),
        order_type: z
          .enum(["buy", "sell", "all"])
          .default("all")
          .describe("Type of orders to retrieve"),
      },
      async ({ region_id, type_id, order_type }) => {
        let endpoint = `/markets/${region_id}/orders/`;
        if (type_id) {
          endpoint += `?type_id=${type_id}`;
        }
    
        const orders = await makeESIRequest<Array<MarketOrder>>(endpoint);
    
        const filteredOrders = orders.filter((order) => {
          if (order_type === "buy") return order.is_buy_order;
          if (order_type === "sell") return !order.is_buy_order;
          return true;
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(filteredOrders, null, 2),
            },
          ],
        };
      }
    );
  • TypeScript interface defining the MarketOrder type used by the handler for typing the API response.
    interface MarketOrder {
      duration: number;
      is_buy_order: boolean;
      issued: string;
      location_id: number;
      min_volume: number;
      order_id: number;
      price: number;
      range: string;
      system_id: number;
      type_id: number;
      volume_remain: number;
      volume_total: number;
    }
  • Helper function used by the handler to make authenticated and rate-limited requests to the EVE ESI API.
    async function makeESIRequest<T>(endpoint: string, token?: string): Promise<T> {
      if (!checkRateLimit(endpoint)) {
        throw new Error("Rate limit exceeded. Please try again later.");
      }
    
      const headers: Record<string, string> = {
        "User-Agent": USER_AGENT,
        "Accept": "application/json",
      };
    
      if (token) {
        headers["Authorization"] = `Bearer ${token}`;
      }
    
      const response = await fetch(`${ESI_BASE_URL}${endpoint}`, { headers });
      updateRateLimit(endpoint, response.headers);
    
      if (!response.ok) {
        let errorMessage = `HTTP error! status: ${response.status}`;
        try {
          const errorData = await response.json() as ESIError;
          if (errorData.error) {
            errorMessage = `ESI Error: ${errorData.error}`;
            if (errorData.error_description) {
              errorMessage += ` - ${errorData.error_description}`;
            }
          }
        } catch {
          // エラーJSONのパースに失敗した場合は、デフォルトのエラーメッセージを使用
        }
        throw new Error(errorMessage);
      }
    
      return response.json() as Promise<T>;
    }
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 data ('Get'), implying a read-only operation, but doesn't cover critical aspects like authentication requirements, rate limits, pagination, error handling, or response format. This is a significant gap for a tool with potential complexity in a market data context.

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 front-loads the core purpose without unnecessary words. Every part ('Get market orders from a specific region') contributes directly to understanding the tool's function, making it appropriately concise and well-structured.

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 lack of annotations and output schema, the description is incomplete for a tool with 3 parameters in a market data context. It doesn't address behavioral traits (e.g., auth needs, data freshness), usage guidelines, or output details, leaving significant gaps that could hinder an agent's ability to use the tool effectively.

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 'from a specific region', which aligns with the required 'region_id' parameter, but adds no meaning beyond what the schema provides. With 100% schema description coverage, the baseline is 3, as the schema already documents all parameters well (e.g., 'order_type' with enum values, 'type_id' for filtering). The description doesn't compensate with additional context like parameter interactions or examples.

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 resource ('market orders') with a specific scope ('from a specific region'), which provides a clear purpose. However, it doesn't differentiate from siblings like 'get-market-history' or 'get-market-prices' beyond mentioning 'orders', leaving some ambiguity about how this tool uniquely fits among market-related tools.

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 like 'get-market-history' or 'get-structure-orders'. It mentions a region scope but doesn't explain prerequisites (e.g., authentication) or exclusions, leaving the agent to infer usage from context 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

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/kongyo2/eve-online-mcp'

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