get_game_info
Fetch detailed information for one or more Steam games by AppID. Includes descriptions, prices, developers, platforms, metacritic scores, and review statistics. Optionally get system requirements and DLC with filtering by review quality.
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
| 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/types.ts:154-158 (schema)Input parameter interface for get_game_info tool. Defines appIds (required array), includeStats, and includeCurrentPlayers.
export interface GetGameInfoInput { appIds: number[]; // Support batch queries includeStats?: boolean; // Default: true includeCurrentPlayers?: boolean; // Default: false } - src/index.ts:60-129 (registration)Tool registration definition for get_game_info in the tools array. Includes name, description, and JSON input schema exposed to MCP clients.
{ 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:278-285 (schema)Zod schema for validating get_game_info input. Extends the basic interface with criteria, includeRequirements, and includeDlc fields.
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/index.ts:504-621 (handler)Main handler for the get_game_info tool (stdio mode). Validates input via Zod schema, fetches game details via SteamAPIClient.getAppDetails, optionally fetches review stats, current player counts, DLC names, filters by criteria, generates info summaries, and returns enriched game data.
} 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:858-949 (handler)Duplicate handler for the get_game_info tool (HTTP/SSE mode). Contains identical logic as the stdio handler - validates input, fetches game details, review stats, current players, DLC names, filters by criteria, and returns enriched results.
} else if (name === 'get_game_info') { const validatedInput = getGameInfoSchema.parse(args); const games = await steamClient.getAppDetails(validatedInput.appIds); 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) { console.error(`Failed to get review summary for ${game.appId}:`, error); reviewSummaries.set(game.appId, null); } }) ); } if (validatedInput.includeCurrentPlayers ?? false) { await Promise.all( games.map(async (game) => { try { game.currentPlayers = await steamClient.getCurrentPlayers(game.appId); } catch (error) { console.error(`Failed to get current players for ${game.appId}:`, error); } }) ); } const gamesWithStats = games.map((game) => ({ ...game, reviewStats: includeStats ? reviewSummaries.get(game.appId) : 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; } } } } } } const processedGames = gamesWithStats.map((game) => { const processed = { ...game }; if (!validatedInput.includeRequirements) delete processed.systemRequirements; if (!validatedInput.includeDlc) delete processed.dlc; return processed; }); let filteredGames = processedGames; if (validatedInput.criteria) { filteredGames = processedGames.filter((game) => meetsGameCriteria(game, validatedInput.criteria!) ); } const enrichedGames = filteredGames.map((game) => ({ ...game, infoSummary: generateInfoSummary(game, game.reviewStats ?? null), })); return { content: [{ type: 'text', text: JSON.stringify(enrichedGames, null, 2) }], };