Skip to main content
Glama

resolve_game

Find the best price for any video game across Steam, PlayStation, Xbox, Nintendo, and more. Get ranked results with prices, editions, and DLC information.

Instructions

Find where to buy a video game at the best price across trusted stores (Steam, PlayStation, Xbox, Nintendo, Epic, GOG, Humble, Fanatical). Returns ranked results with prices, editions, and DLC info. Note: the games vertical is launching soon — this tool currently returns a 'coming soon' message. Prefer resolve_music or find_product for music queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe game slug. Format: game-title (lowercase, hyphenated). Example: 'elden-ring'

Implementation Reference

  • The main resolver function for the resolve_game tool. Fetches game pricing data from MainMenu's /api/v1/games/:slug/json endpoint, validates the response against the v1 schema, and returns ranked results with prices, editions, and DLC info.
    export async function resolveGame(input: ResolveGameInput): Promise<ResolveGameResult> {
        const { slug } = input;
        const url = `${MAINMENU_BASE}/api/v1/games/${encodeURIComponent(slug)}/json`;
    
        try {
            const res = await fetch(url, {
                headers: {
                    "User-Agent": "rootvine-mcp/1.0.2",
                    "Accept": "application/json",
                },
                signal: AbortSignal.timeout(5000),
            });
    
            if (!res.ok && res.status !== 404) {
                return {
                    success: false,
                    error: `MainMenu returned HTTP ${res.status}`,
                };
            }
    
            const data = await res.json();
    
            // Validate against v1 schema
            const validation = validateResponse(data);
            if (!validation.success) {
                return {
                    success: false,
                    error: `Response validation failed: ${validation.error.message}`,
                };
            }
    
            return {
                success: true,
                response: validation.data as RootVineResponseV1,
            };
        } catch (err) {
            const message = err instanceof Error ? err.message : "Unknown error";
            return {
                success: false,
                error: `Failed to reach MainMenu: ${message}`,
            };
        }
    }
  • Input schema for the resolve_game tool: expects a slug string identifying the game.
    export interface ResolveGameInput {
        slug: string;
    }
  • Output schema for the resolve_game tool: returns success status, optional response data (RootVineResponseV1), and optional error message.
    export interface ResolveGameResult {
        success: boolean;
        response?: RootVineResponseV1;
        error?: string;
    }
  • src/index.ts:88-121 (registration)
    Registration of the resolve_game tool with the MCP server. Registers it with name 'resolve_game', slug input schema, and a handler that calls resolveGame() and formats the response using formatGameResponse().
    server.registerTool(
        "resolve_game",
        {
            description: "Find where to buy a video game at the best price across trusted stores (Steam, PlayStation, Xbox, Nintendo, Epic, GOG, Humble, Fanatical). Returns ranked results with prices, editions, and DLC info. Note: the games vertical is launching soon — this tool currently returns a 'coming soon' message. Prefer `resolve_music` or `find_product` for music queries.",
            inputSchema: {
                slug: z
                    .string()
                    .describe("The game slug. Format: game-title (lowercase, hyphenated). Example: 'elden-ring'"),
            },
        },
        async ({ slug }) => {
            const result = await resolveGame({ slug });
    
            if (!result.success || !result.response) {
                return {
                    content: [
                        {
                            type: "text" as const,
                            text: `Could not resolve game: ${result.error || "Unknown error"}`,
                        },
                    ],
                };
            }
    
            return {
                content: [
                    {
                        type: "text" as const,
                        text: formatGameResponse(result.response),
                    },
                ],
            };
        },
    );
  • Formats a game response (RootVineResponseV1) into a human-readable string for agent display. Handles error, no_results, and success states with ranked merchant results, prices, edition info, DLC count, and warnings.
    export function formatGameResponse(response: RootVineResponseV1): string {
        const lines: string[] = [];
    
        // Header
        lines.push(`🎮 ${response.query.title || response.query.raw}`);
        lines.push("");
    
        if (response.status === "error" && response.error) {
            lines.push(`❌ Error: ${response.error.message}`);
            if (response.error.retryable) {
                lines.push("(This error is retryable)");
            }
            return lines.join("\n");
        }
    
        if (response.status === "no_results") {
            lines.push("No results found for this game.");
            if (response.source_url) {
                lines.push(`Source: ${response.source_url}`);
            }
            return lines.join("\n");
        }
    
        // Results
        for (const result of response.results) {
            const priceStr = result.price
                ? `${result.price.currency} ${result.price.amount.toFixed(2)}`
                : "Price unknown";
    
            const link = result.click_url || result.url;
            const edition = result.edition ? ` (${result.edition})` : "";
    
            lines.push(
                `${result.rank}. **${result.merchant}**${edition} (${result.trust_tier})`,
                `   🛒 ${priceStr} — ${result.availability.replace("_", " ")}`,
                `   ${link}`,
                "",
            );
        }
    
        // DLC count
        if ("dlc_count" in response && response.dlc_count) {
            lines.push(`📦 ${response.dlc_count} DLC/expansions available`);
        }
    
        // Warnings
        if (response.warnings.length > 0) {
            lines.push(`⚠️ Warnings: ${response.warnings.join(", ")}`);
        }
    
        // Source
        if (response.source_url) {
            lines.push(`Source: ${response.source_url}`);
        }
    
        return lines.join("\n");
    }
Behavior4/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 disclosure. It transparently notes the tool is currently non-functional, returning a 'coming soon' message, which is a key behavioral trait. However, it does not explicitly mention read-only nature or other side effects.

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 concise and well-structured: a single sentence for purpose, a second for details, and a crucial note about current status. Every sentence adds value without repetition.

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 no output schema, the description explains the return format (ranked results with prices, editions, DLC info) and the current limitation. It covers the stores list. It is mostly complete but lacks mention of error handling or data freshness.

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 schema coverage is 100% for the single required parameter. The description adds no additional meaning beyond the schema, repeating the slug format and example from the schema. Thus, the baseline score of 3 is appropriate.

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: finding where to buy a video game at the best price across specific trusted stores. It distinguishes itself from siblings by targeting games versus music.

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

Usage Guidelines5/5

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

The description not only explains when to use the tool (for game purchases) but also advises when not to use it (for music queries) and provides alternatives (`resolve_music` or `find_product`), fulfilling the guidelines dimension well.

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/RagingOrangutan/rootvine-mcp'

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