Skip to main content
Glama

assign_category

Add a game to a category in your Lutris Linux gaming library to organize your collection.

Instructions

Add a game to a category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
game_idYesGame ID
category_nameYesCategory name

Implementation Reference

  • Tool handler for "assign_category". Validates existence of the game, gets/creates the category, and calls the database function.
    server.tool(
      "assign_category",
      "Add a game to a category",
      {
        game_id: z.coerce.number().describe("Game ID"),
        category_name: z.string().describe("Category name"),
      },
      async (params) => {
        try {
          const game = getGameById(params.game_id);
          if (!game) {
            return {
              content: [{ type: "text", text: `Game with id ${params.game_id} not found.` }],
              isError: true,
            };
          }
    
          let category = getCategoryByName(params.category_name);
          if (!category) {
            category = createCategory(params.category_name);
          }
    
          assignCategory(params.game_id, category.id);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(
                  { message: `"${game.name}" assigned to "${category.name}".` },
                  null,
                  2
                ),
              },
            ],
          };
        } catch (error) {
          return handleError(error);
        }
      }
    );
  • Database implementation of the assign_category logic.
    export function assignCategory(gameId: number, categoryId: number): void {
      const db = getDatabase();
      db.prepare(
        "INSERT OR IGNORE INTO games_categories (game_id, category_id) VALUES (?, ?)"
      ).run(gameId, categoryId);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. 'Add' implies a mutation, but it doesn't disclose behavioral traits like permission requirements, whether duplicates are allowed, error conditions, or side effects. This leaves significant gaps for a tool that modifies data.

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, clear sentence with zero waste. It's appropriately sized and front-loaded, efficiently conveying the core purpose without unnecessary elaboration.

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?

Given the complexity of a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, error handling, or return values, making it inadequate for safe and effective use by an AI agent.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters ('game_id' and 'category_name') with basic descriptions. The description adds no additional meaning beyond implying these parameters are used for the assignment, meeting the baseline for high schema coverage.

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 ('Add') and the target ('a game to a category'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'unassign_category' or explain how this relates to 'create_category' for new categories versus assigning to existing ones.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the game and category must exist), when not to use it, or how it interacts with siblings like 'unassign_category' or 'create_category'.

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