Skip to main content
Glama

remove_game

Remove a game from the Lutris database to clean up your library without deleting game files. Use this tool to manage your game collection by removing entries you no longer need.

Instructions

Remove a game from the Lutris database (does not delete files)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGame ID to remove
confirmYesMust be true to confirm deletion

Implementation Reference

  • The implementation of the 'remove_game' tool. It validates the 'confirm' parameter, checks if the game exists, and calls 'deleteGame' to remove it from the database.
    server.tool(
      "remove_game",
      "Remove a game from the Lutris database (does not delete files)",
      {
        id: z.coerce.number().describe("Game ID to remove"),
        confirm: z.boolean().describe("Must be true to confirm deletion"),
      },
      async (params) => {
        try {
          if (!params.confirm) {
            return {
              content: [
                { type: "text", text: "Set confirm to true to delete the game." },
              ],
              isError: true,
            };
          }
    
          const game = getGameById(params.id);
          if (!game) {
            return {
              content: [{ type: "text", text: `Game with id ${params.id} not found.` }],
              isError: true,
            };
          }
    
          deleteGame(params.id);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  { message: `Removed "${game.name}" (id: ${game.id}) from library.` },
                  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