Skip to main content
Glama
sergeyklay

poe2-mcp-server

by sergeyklay

PoE2 Top Exchange Items

poe2_exchange_top
Read-onlyIdempotent

Retrieve top-valued items by chaos-equivalent value from Path of Exile 2 exchange categories like Currency, Fragments, or Essences for informed trading decisions.

Instructions

Get the most valuable items in a given exchange category in Path of Exile 2.

Args:

  • type (string): Exchange category — Currency, Fragments, Essences, SoulCores, Idols, Runes, etc.

  • limit (number): How many to return (default: 10, max: 30)

  • league (string): League name (default: "Fate of the Vaal")

Returns: Top N most valuable items sorted by chaos-equivalent value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesExchange category
limitNoNumber of results
leagueNoFate of the Vaal

Implementation Reference

  • Main implementation of poe2_exchange_top tool handler. Contains the tool registration, input schema (type, limit, league), and async handler function that fetches data from poe.ninja and returns the top N most valuable items in a given exchange category sorted by chaos-equivalent value.
      // ── poe2_exchange_top ─────────────────────────────────────────────
      server.registerTool(
        'poe2_exchange_top',
        {
          title: 'PoE2 Top Exchange Items',
          description: `Get the most valuable items in a given exchange category in Path of Exile 2.
    
    Args:
      - type (string): Exchange category — Currency, Fragments, Essences, SoulCores, Idols, Runes, etc.
      - limit (number): How many to return (default: 10, max: 30)
      - league (string): League name (default: "Fate of the Vaal")
    
    Returns: Top N most valuable items sorted by chaos-equivalent value.`,
          inputSchema: {
            type: z.enum(EXCHANGE_TYPES).describe('Exchange category'),
            limit: z.number().int().min(1).max(30).default(10).describe('Number of results'),
            league: z.string().default(DEFAULT_LEAGUE),
          },
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: true,
          },
        },
        async ({ type, limit, league }) => {
          try {
            const data = await getNinjaExchangeOverview(league, type);
    
            const coreNames = new Map<string, string>();
            for (const item of data.core.items) {
              coreNames.set(item.id, item.name);
            }
    
            const chaosRate = data.core.rates[data.core.secondary] ?? 1;
    
            const sorted = [...data.lines].sort((a, b) => b.primaryValue - a.primaryValue);
            const top = sorted.slice(0, limit);
    
            const lines: string[] = [`## Top ${limit} ${type} — ${league}`, ''];
            for (let i = 0; i < top.length; i++) {
              const item = top[i]!;
              const name = displayName(item.id, coreNames);
              const chaosValue = (item.primaryValue * chaosRate).toFixed(1);
              const volume = item.volumePrimaryValue ?? 0;
              lines.push(`${i + 1}. **${name}** — ${chaosValue} chaos (volume: ${volume})`);
            }
    
            return {
              content: [{ type: 'text', text: lines.join('\n') }],
            };
          } catch (error) {
            const msg = error instanceof Error ? error.message : String(error);
            return {
              isError: true,
              content: [{ type: 'text', text: `Error: ${msg}` }],
            };
          }
        },
      );
  • Input validation schema for poe2_exchange_top using zod: type (enum of EXCHANGE_TYPES), limit (int, 1-30, default 10), league (string, default 'Fate of the Vaal').
    inputSchema: {
      type: z.enum(EXCHANGE_TYPES).describe('Exchange category'),
      limit: z.number().int().min(1).max(30).default(10).describe('Number of results'),
      league: z.string().default(DEFAULT_LEAGUE),
    },
  • Helper function getNinjaExchangeOverview that fetches PoE2 exchange overview data from poe.ninja API with rate limiting. Returns NinjaExchangeResponse with core item data and pricing lines.
    export async function getNinjaExchangeOverview(
      league: string,
      type: string,
    ): Promise<NinjaExchangeResponse> {
      const url = `${NINJA_POE2_BASE}/exchange/current/overview?league=${encodeURIComponent(league)}&type=${encodeURIComponent(type)}`;
      return fetchJson<NinjaExchangeResponse>(url, ninjaLimiter);
    }
  • Type definition NinjaExchangeResponse defining the structure of API responses from poe.ninja exchange overview endpoint, used by poe2_exchange_top handler.
    export interface NinjaExchangeResponse {
      core: NinjaExchangeCore;
      lines: NinjaExchangeLine[];
    }
  • EXCHANGE_TYPES constant array defining valid exchange categories (Currency, Fragments, Abyss, UncutGems, etc.) used for input validation in poe2_exchange_top schema.
    const EXCHANGE_TYPES = [
      'Currency',
      'Fragments',
      'Abyss',
      'UncutGems',
      'LineageSupportGems',
      'Essences',
      'SoulCores',
      'Idols',
      'Runes',
      'Ritual',
      'Expedition',
      'Delirium',
      'Breach',
    ] as const;
Behavior4/5

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

Annotations already declare read-only, open-world, idempotent, and non-destructive traits. The description adds valuable context beyond annotations by specifying sorting criteria ('sorted by chaos-equivalent value'), return format ('Top N most valuable items'), and default values, though it omits details like rate limits or authentication needs.

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 front-loaded with the core purpose, followed by a structured breakdown of args and returns in bullet points. Every sentence adds value with no redundancy, making it efficient and easy to parse.

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

Completeness4/5

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

Given the tool's moderate complexity (3 parameters, no output schema) and rich annotations, the description is largely complete. It covers purpose, parameters, and returns adequately, though it could benefit from more explicit sibling differentiation or error handling details to reach a perfect score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 67% (two parameters have descriptions, one lacks). The description compensates by explaining the purpose of 'type' ('Exchange category'), clarifying 'limit' ('How many to return'), and providing default and max values not in the schema, adding meaningful context beyond the structured fields.

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

Purpose5/5

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

The description clearly states the specific action ('Get the most valuable items') and resource ('in a given exchange category in Path of Exile 2'), distinguishing it from siblings like currency-specific or wiki tools by focusing on top-value items across multiple categories.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving top-value items by category but provides no explicit guidance on when to use this tool versus alternatives like poe2_currency_prices or poe2_item_price, nor does it mention prerequisites or exclusions.

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/sergeyklay/poe2-mcp-server'

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