get_game_info
Fetch detailed Steam game data including descriptions, prices, reviews, and system requirements using AppIDs to support informed purchasing decisions.
Instructions
Get detailed information about one or more Steam games by AppID. Returns comprehensive game data including description, price, developers, publishers, platforms, metacritic score, review statistics, and optionally system requirements and DLC list. Supports filtering by review quality criteria.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appIds | Yes | Array of Steam AppIDs to fetch information for (supports batch queries) | |
| includeStats | No | Include review statistics (default: true) | |
| includeCurrentPlayers | No | Include current player count (default: false) | |
| criteria | No | Optional filter criteria - only games matching ALL criteria will be returned | |
| includeRequirements | No | Include system requirements (PC minimum/recommended specs) | |
| includeDlc | No | Include list of available DLC |
Implementation Reference
- src/index.ts:504-621 (handler)Main handler for get_game_info tool - validates input, fetches game details from Steam API, optionally includes review stats, current players, DLC names, system requirements, and applies filter criteria before returning enriched results with info summaries.
} else if (name === 'get_game_info') { const validatedInput = getGameInfoSchema.parse(args); // Fetch game details const games = await steamClient.getAppDetails(validatedInput.appIds); // Determine if we need review stats (default: include, or required for criteria) const hasCriteria = validatedInput.criteria !== undefined; const includeStats = validatedInput.includeStats !== false || hasCriteria; const reviewSummaries = new Map<number, ReviewStats | null>(); if (includeStats) { await Promise.all( games.map(async (game) => { try { const stats = await steamClient.getReviewSummary(game.appId); reviewSummaries.set(game.appId, stats); } catch (error) { // Silently fail for review stats (not critical) console.error(`Failed to get review summary for ${game.appId}:`, error); reviewSummaries.set(game.appId, null); } }) ); } // Optionally include current players if (validatedInput.includeCurrentPlayers ?? false) { await Promise.all( games.map(async (game) => { try { game.currentPlayers = await steamClient.getCurrentPlayers(game.appId); } catch (error) { // Silently fail for current players (not critical) console.error(`Failed to get current players for ${game.appId}:`, error); } }) ); } // Build enriched games with review stats attached const gamesWithStats = games.map((game) => { const reviewStats = reviewSummaries.get(game.appId); return { ...game, reviewStats: includeStats ? reviewStats : undefined, }; }); // Fetch DLC names if requested if (validatedInput.includeDlc) { // Collect all DLC AppIDs from all games const allDlcAppIds: number[] = []; for (const game of gamesWithStats) { if (game.dlc && game.dlc.length > 0) { for (const dlc of game.dlc) { if (dlc.appId) { allDlcAppIds.push(dlc.appId); } } } } // Fetch DLC names in parallel if (allDlcAppIds.length > 0) { const dlcNames = await steamClient.fetchDlcNames(allDlcAppIds); // Update DLC names in games for (const game of gamesWithStats) { if (game.dlc && game.dlc.length > 0) { for (const dlc of game.dlc) { const name = dlcNames.get(dlc.appId); if (name) { dlc.name = name; } } } } } } // Strip out optional fields if not requested const processedGames = gamesWithStats.map((game) => { const processed = { ...game }; if (!validatedInput.includeRequirements) { delete processed.systemRequirements; } if (!validatedInput.includeDlc) { delete processed.dlc; } return processed; }); // Filter by criteria if provided let filteredGames = processedGames; if (validatedInput.criteria) { filteredGames = processedGames.filter((game) => meetsGameCriteria(game, validatedInput.criteria!) ); } // Generate info summaries for filtered results const enrichedGames = filteredGames.map((game) => ({ ...game, infoSummary: generateInfoSummary(game, game.reviewStats ?? null), })); return { content: [ { type: 'text', text: JSON.stringify(enrichedGames, null, 2), }, ], }; - src/index.ts:60-130 (registration)Tool registration in the tools array - defines the tool name, description, and input schema including appIds, includeStats, includeCurrentPlayers, criteria, includeRequirements, and includeDlc parameters.
{ name: 'get_game_info', description: 'Get detailed information about one or more Steam games by AppID. Returns comprehensive game data including description, price, developers, publishers, platforms, metacritic score, review statistics, and optionally system requirements and DLC list. Supports filtering by review quality criteria.', inputSchema: { type: 'object', properties: { appIds: { type: 'array', items: { type: 'number' }, description: 'Array of Steam AppIDs to fetch information for (supports batch queries)', minItems: 1, maxItems: 10, }, includeStats: { type: 'boolean', description: 'Include review statistics (default: true)', }, includeCurrentPlayers: { type: 'boolean', description: 'Include current player count (default: false)', }, criteria: { type: 'object', description: 'Optional filter criteria - only games matching ALL criteria will be returned', properties: { minReviewScore: { type: 'number', description: 'Minimum review score percentage (0-100)', minimum: 0, maximum: 100, }, minReviews: { type: 'number', description: 'Minimum number of total reviews', minimum: 0, }, maxPrice: { type: 'number', description: 'Maximum price in cents (e.g., 1999 for $19.99)', minimum: 0, }, requireFree: { type: 'boolean', description: 'Only include free games', }, requireMetacritic: { type: 'boolean', description: 'Only include games with metacritic scores', }, minMetacritic: { type: 'number', description: 'Minimum metacritic score (0-100)', minimum: 0, maximum: 100, }, }, }, includeRequirements: { type: 'boolean', description: 'Include system requirements (PC minimum/recommended specs)', }, includeDlc: { type: 'boolean', description: 'Include list of available DLC', }, }, required: ['appIds'], }, }, - src/index.ts:276-285 (schema)Zod validation schema for get_game_info input - validates appIds array (1-10 items), optional booleans for stats/current players/DLC/requirements, and optional criteria object.
* Zod schema for validating get_game_info input. */ const getGameInfoSchema = z.object({ appIds: z.array(z.number()).min(1).max(10), includeStats: z.boolean().optional(), includeCurrentPlayers: z.boolean().optional(), criteria: gameInfoCriteriaSchema.optional(), includeRequirements: z.boolean().optional(), includeDlc: z.boolean().optional(), }); - src/types.ts:152-158 (schema)TypeScript interface for get_game_info input parameters - defines appIds as number array, and optional includeStats and includeCurrentPlayers booleans.
* Input parameters for get_game_info tool */ export interface GetGameInfoInput { appIds: number[]; // Support batch queries includeStats?: boolean; // Default: true includeCurrentPlayers?: boolean; // Default: false } - src/index.ts:370-417 (helper)Helper function meetsGameCriteria - filters games based on specified criteria including minReviewScore, minReviews, maxPrice, requireFree, requireMetacritic, and minMetacritic. All criteria are AND conditions.
function meetsGameCriteria( game: SteamGame & { reviewStats?: ReviewStats | null }, criteria: GameInfoCriteria ): boolean { // Check min review score if (criteria.minReviewScore !== undefined) { if (!game.reviewStats || game.reviewStats.scorePercent < criteria.minReviewScore) { return false; } } // Check min reviews if (criteria.minReviews !== undefined) { if (!game.reviewStats || game.reviewStats.totalReviews < criteria.minReviews) { return false; } } // Check max price if (criteria.maxPrice !== undefined) { if (game.priceRaw === undefined || game.priceRaw > criteria.maxPrice) { return false; } } // Check require free if (criteria.requireFree === true) { if (!game.isFree) { return false; } } // Check require metacritic if (criteria.requireMetacritic === true) { if (!game.metacriticScore) { return false; } } // Check min metacritic if (criteria.minMetacritic !== undefined) { if (!game.metacriticScore || game.metacriticScore < criteria.minMetacritic) { return false; } } return true; }