Skip to main content
Glama

create_category

Organize games in your Lutris library by creating custom categories to group and manage your collection effectively.

Instructions

Create a new game category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCategory name

Implementation Reference

  • The tool handler implementation for "create_category" which accepts a name parameter, calls the DB helper, and formats the result.
    server.tool(
      "create_category",
      "Create a new game category",
      {
        name: z.string().describe("Category name"),
      },
      async (params) => {
        try {
          const category = createCategory(params.name);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ message: "Category created", category }, null, 2),
              },
            ],
          };
        } catch (error) {
          return handleError(error);
        }
      }
    );
  • The database query function that actually inserts the new category into the SQLite database.
    export function createCategory(name: string): Category {
      const db = getDatabase();
      const result = db
        .prepare("INSERT INTO categories (name) VALUES (?)")
        .run(name);
      return { id: result.lastInsertRowid as number, name };
    }

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