Skip to main content
Glama

resolve_game

Find where to buy video games at the best price by comparing prices across trusted stores like Steam, PlayStation, Xbox, Nintendo, and Epic Games.

Instructions

Find where to buy a video game at the best price. Returns ranked results from trusted game stores (Steam, PlayStation, Xbox, Nintendo, Epic, etc.) with prices, editions, and DLC info. Use this when a user asks about video games.

Input Schema

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

Implementation Reference

  • The main handler function that executes the resolve_game tool logic. It calls the MainMenu API endpoint, validates the response against the v1 schema, and returns the ranked results.
    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.0",
                    "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 and output interface definitions for the resolve_game tool. ResolveGameInput takes a slug parameter, and ResolveGameResult contains success status and either the validated response or an error message.
    export interface ResolveGameInput {
        slug: string;
    }
    
    export interface ResolveGameResult {
        success: boolean;
        response?: RootVineResponseV1;
        error?: string;
    }
  • src/index.ts:87-120 (registration)
    MCP tool registration for resolve_game. Registers the tool with its description, input schema (slug parameter using Zod validation), and handler that calls resolveGame and formats the response for the agent.
    server.registerTool(
        "resolve_game",
        {
            description: "Find where to buy a video game at the best price. Returns ranked results from trusted game stores (Steam, PlayStation, Xbox, Nintendo, Epic, etc.) with prices, editions, and DLC info. Use this when a user asks about video games.",
            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),
                    },
                ],
            };
        },
    );
  • Helper function that formats the RootVine API response into a human-readable text format for display to the agent/user. Handles success, error, and no_results statuses, and formats ranked merchant results with prices and links.
    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");
    }
  • Zod validation function that validates responses from Vine endpoints against the v1 schema. Used by resolveGame to ensure data integrity before returning results to the agent.
    export function validateResponse(data: unknown) {
        return RootVineResponseV1Schema.safeParse(data);
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it returns ranked results from trusted stores with prices, editions, and DLC info. However, it lacks details on error handling, rate limits, or authentication needs, which are important for a tool interacting with external stores.

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 in the first sentence, followed by return details and usage guidance. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

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

Completeness3/5

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

Given no annotations and no output schema, the description adequately covers the tool's purpose and usage but lacks details on output structure (e.g., format of ranked results) and error scenarios. It is complete enough for basic use but could benefit from more behavioral context for robust agent operation.

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 documents the 'slug' parameter with format and example. The description does not add any parameter-specific details beyond what the schema provides, such as explaining how to derive the slug or handle edge cases, meeting the baseline for high schema coverage.

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 ('Find where to buy'), resource ('a video game'), and scope ('at the best price'), distinguishing it from sibling tools like 'find_product' and 'resolve_music' by focusing exclusively on video games with price comparisons across specific platforms.

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?

It explicitly states 'Use this when a user asks about video games,' providing clear context for when to invoke the tool. However, it does not specify when not to use it or mention alternatives, such as whether 'find_product' might handle non-video game products.

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