Skip to main content
Glama

add_game

Add a new game to the Lutris Linux gaming library by specifying name, runner, and optional details like platform, directory, and executable path.

Instructions

Add a new game to the Lutris library

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesGame name
runnerYesRunner (e.g. linux, wine, steam)
platformNoPlatform
directoryNoInstall directory
executableNoExecutable path
yearNoRelease year
serviceNoService (e.g. steam)
service_idNoService ID
slugNoCustom slug (auto-generated if omitted)
installedNoMark as installed

Implementation Reference

  • The 'add_game' tool implementation, including schema definition and handler logic.
    server.tool(
      "add_game",
      "Add a new game to the Lutris library",
      {
        name: z.string().describe("Game name"),
        runner: z.string().describe("Runner (e.g. linux, wine, steam)"),
        platform: z.string().optional().describe("Platform"),
        directory: z.string().optional().describe("Install directory"),
        executable: z.string().optional().describe("Executable path"),
        year: z.coerce.number().optional().describe("Release year"),
        service: z.string().optional().describe("Service (e.g. steam)"),
        service_id: z.string().optional().describe("Service ID"),
        slug: z.string().optional().describe("Custom slug (auto-generated if omitted)"),
        installed: z.boolean().default(false).describe("Mark as installed"),
      },
      async (params) => {
        try {
          const gameData: Record<string, unknown> = {
            name: params.name,
            runner: params.runner,
            slug: params.slug || generateSlug(params.name),
            installed: params.installed ? 1 : 0,
          };
    
          if (params.platform) gameData.platform = params.platform;
          if (params.directory) gameData.directory = params.directory;
          if (params.executable) gameData.executable = params.executable;
          if (params.year) gameData.year = params.year;
          if (params.service) gameData.service = params.service;
          if (params.service_id) gameData.service_id = params.service_id;
    
          const game = insertGame(gameData);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ message: "Game added successfully", game }, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleError(error);
        }
      }
    );

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/Praeses0/lutris-mcp'

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