get_game
Retrieve comprehensive game details including categories and configuration data from the Lutris Linux gaming library database.
Instructions
Get full details for a specific game including categories and YAML config
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Game ID | |
| slug | No | Game slug |
Implementation Reference
- src/tools/games.ts:67-106 (handler)The handler for the "get_game" tool, which retrieves game details by id or slug, fetches associated categories, reads the game configuration, and returns the combined information.
server.tool( "get_game", "Get full details for a specific game including categories and YAML config", { id: z.coerce.number().optional().describe("Game ID"), slug: z.string().optional().describe("Game slug"), }, async (params) => { try { if (!params.id && !params.slug) { return { content: [{ type: "text", text: "Provide either id or slug." }], isError: true, }; } const game = params.id ? getGameById(params.id) : getGameBySlug(params.slug!); if (!game) { return { content: [{ type: "text", text: `Game not found.` }], isError: true, }; } const categories = getGameCategories(game.id); const config = readGameConfig(game.configpath); return { content: [ { type: "text", text: JSON.stringify({ ...game, categories, config }, null, 2), }, ], }; } catch (error) { return handleError(error); } } );