Skip to main content
Glama
sergeyklay

poe2-mcp-server

by sergeyklay

PoE2 Check Currency Value

poe2_currency_check
Read-onlyIdempotent

Check current Path of Exile 2 currency values in chaos orbs and trade volume by searching partial currency names across different leagues.

Instructions

Look up the current value of a specific currency in Path of Exile 2.

Searches by partial name match (case-insensitive) against currency ids and reference item names.

Args:

  • name (string): Currency name or partial name, e.g. "exalted", "divine", "regal"

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

Returns: Matched currency with its chaos-equivalent value and trade volume.

Examples:

  • "How much is a Divine Orb?" → name="divine"

  • "Price of Regal Orb" → name="regal"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCurrency name or partial match
leagueNoPoE2 league name, e.g. "Fate of the Vaal" or "Standard"Fate of the Vaal

Implementation Reference

  • Main handler function for poe2_currency_check tool. Fetches currency exchange data from poe.ninja API, performs case-insensitive partial name matching against currency IDs and names, calculates chaos-equivalent values, and returns formatted results with trade volumes.
    async ({ name, league }) => {
      try {
        const data = await getNinjaExchangeOverview(league, 'Currency');
        const query = name.toLowerCase();
    
        // Build lookup: id → human-readable name from core reference items
        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;
    
        // Match against core item names and line ids
        const matches: Array<{
          id: string;
          name: string;
          chaosValue: number;
          volume: number;
        }> = [];
    
        for (const line of data.lines) {
          const itemName = coreNames.get(line.id);
          const matchesQuery =
            line.id.toLowerCase().includes(query) ||
            (itemName?.toLowerCase().includes(query) ?? false);
    
          if (matchesQuery) {
            matches.push({
              id: line.id,
              name: displayName(line.id, coreNames),
              chaosValue: line.primaryValue * chaosRate,
              volume: line.volumePrimaryValue ?? 0,
            });
          }
        }
    
        if (matches.length === 0) {
          return {
            content: [
              {
                type: 'text',
                text: `No currency found matching "${name}" in ${league}.\n\nTip: Try a shorter search term like "divine", "exalted", "chaos", etc.`,
              },
            ],
          };
        }
    
        const lines: string[] = [`## Currency: "${name}" — ${league}`, ''];
        for (const match of matches) {
          lines.push(`**${match.name}** (${match.id})`);
          lines.push(`- Chaos equivalent: ${match.chaosValue.toFixed(2)}`);
          lines.push(`- Trade volume: ${match.volume}`);
          lines.push('');
        }
    
        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}` }],
        };
      }
    },
  • Tool registration for poe2_currency_check, including title, description, input schema (name and league parameters), and annotations (readOnly, non-destructive, idempotent, openWorld hints).
      server.registerTool(
        'poe2_currency_check',
        {
          title: 'PoE2 Check Currency Value',
          description: `Look up the current value of a specific currency in Path of Exile 2.
    
    Searches by partial name match (case-insensitive) against currency ids and reference item names.
    
    Args:
      - name (string): Currency name or partial name, e.g. "exalted", "divine", "regal"
      - league (string): League name (default: "Fate of the Vaal")
    
    Returns: Matched currency with its chaos-equivalent value and trade volume.
    
    Examples:
      - "How much is a Divine Orb?" → name="divine"
      - "Price of Regal Orb" → name="regal"`,
          inputSchema: {
            name: z.string().min(2).describe('Currency name or partial match'),
            league: LeagueSchema,
          },
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: true,
          },
        },
  • LeagueSchema definition using Zod validation with default league value 'Fate of the Vaal'.
    const LeagueSchema = z
      .string()
      .default(DEFAULT_LEAGUE)
      .describe('PoE2 league name, e.g. "Fate of the Vaal" or "Standard"');
  • API helper function getNinjaExchangeOverview that fetches PoE2 currency exchange data from poe.ninja with rate limiting support.
    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);
    }
  • Helper function displayName that converts currency ID slugs to title-case format for display purposes.
    function displayName(id: string, coreNames: Map<string, string>): string {
      return coreNames.get(id) ?? id.charAt(0).toUpperCase() + id.slice(1);
    }
Behavior4/5

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

Annotations already provide readOnlyHint, openWorldHint, idempotentHint, and destructiveHint, covering safety and idempotency. The description adds valuable behavioral context beyond annotations: it specifies partial name matching (case-insensitive), mentions searching against both currency ids and reference item names, and indicates the return includes chaos-equivalent value and trade volume. This enhances understanding of how the tool behaves operationally.

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 well-structured and appropriately sized. It starts with a clear purpose statement, followed by key behavioral details, then parameter explanations with examples. Every sentence adds value without redundancy, and the examples are directly relevant to tool usage.

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 (2 parameters, no output schema), the description is mostly complete. It covers purpose, usage context, behavioral traits, and parameter examples. However, without an output schema, it could benefit from more detail on the return format (e.g., structure of 'matched currency' data), though the mention of 'chaos-equivalent value and trade volume' provides some guidance.

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 schema already fully documents both parameters. The description adds minimal extra semantics: it provides examples for the 'name' parameter (e.g., 'exalted', 'divine', 'regal') and mentions the default league. However, this doesn't significantly enhance meaning beyond what's in the schema descriptions, warranting the baseline score of 3.

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 tool's purpose: 'Look up the current value of a specific currency in Path of Exile 2.' This is a specific verb ('look up') + resource ('currency value') combination. It distinguishes from siblings like poe2_item_price (for items) and poe2_currency_prices (likely broader currency listings).

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: for checking currency values with partial name matching. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings (e.g., when to use poe2_currency_prices instead). The examples help illustrate appropriate use cases.

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