Skip to main content
Glama

update_game

Modify game details in your Lutris library by updating fields like name, platform, directory, or executable path to keep your gaming collection organized.

Instructions

Update fields on an existing game

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesGame ID to update
nameNo
slugNo
runnerNo
platformNo
directoryNo
executableNo
yearNo
serviceNo
service_idNo
installedNo
sortnameNo
discord_idNo

Implementation Reference

  • The `update_game` tool registration and handler in `src/tools/games.ts`. It validates input using Zod and calls the database `updateGame` function.
    server.tool(
      "update_game",
      "Update fields on an existing game",
      {
        id: z.coerce.number().describe("Game ID to update"),
        name: z.string().optional(),
        slug: z.string().optional(),
        runner: z.string().optional(),
        platform: z.string().optional(),
        directory: z.string().optional(),
        executable: z.string().optional(),
        year: z.coerce.number().optional(),
        service: z.string().optional(),
        service_id: z.string().optional(),
        installed: z.boolean().optional(),
        sortname: z.string().optional(),
        discord_id: z.string().optional(),
      },
      async (params) => {
        try {
          const { id, installed, ...rest } = params;
          const existing = getGameById(id);
          if (!existing) {
            return {
              content: [{ type: "text", text: `Game with id ${id} not found.` }],
              isError: true,
            };
          }
    
          const updates: Record<string, unknown> = {};
          for (const [k, v] of Object.entries(rest)) {
            if (v !== undefined) updates[k] = v;
          }
          if (installed !== undefined) updates.installed = installed ? 1 : 0;
    
          const game = updateGame(id, updates);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ message: "Game updated", game }, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleError(error);
        }
      }
    );
  • The actual database implementation of `updateGame` that performs the SQL update query.
    export function updateGame(
      id: number,
      updates: Partial<Omit<Game, "id">>
    ): Game | undefined {
      const db = getDatabase();
      const fields = Object.keys(updates);
      if (fields.length === 0) return getGameById(id);
    
      const sets = fields.map((f) => `${f} = :${f}`).join(", ");
      db.prepare(`UPDATE games SET ${sets} WHERE id = :id`).run({
        ...updates,
        id,
      } as Record<string, unknown>);
      return getGameById(id);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Update' implies a mutation operation, but the description doesn't specify whether this requires authentication, what happens to unspecified fields (partial vs. full updates), whether changes are reversible, or any rate limits. This leaves significant behavioral gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a basic tool description and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 13 parameters, 8% schema coverage, no annotations, and no output schema, the description is severely inadequate. It doesn't explain what happens when the tool executes, what values are returned, or provide any context about the update operation's scope or effects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 8% schema description coverage (only the 'id' parameter has a description), the description provides no additional parameter information beyond what's implied by the tool name. It doesn't explain what fields can be updated, their purposes, or any constraints, failing to compensate for the poor schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('update') and target resource ('fields on an existing game'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'add_game' or 'remove_game' beyond the basic verb distinction, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'add_game' for creating new games or 'get_game' for reading. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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