Skip to main content
Glama

add_class

Create new character classes in RPG Maker MZ projects by specifying class ID and name to expand game customization options.

Instructions

Add a new class to the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesClass ID
nameYesClass name
project_pathYesPath to the RPG Maker MZ project directory

Implementation Reference

  • The core handler function that reads Classes.json, adds a default class entry at the given ID with the specified name using getDefaultClass helper, writes back the JSON, and returns success with the ID.
    export async function addClass(projectPath: string, id: number, name: string) {
      const classesPath = path.join(projectPath, "data", "Classes.json");
      const classesContent = await fs.readFile(classesPath, "utf-8");
      const classes = JSON.parse(classesContent);
    
      classes[id] = getDefaultClass(id, name);
      await fs.writeFile(classesPath, JSON.stringify(classes, null, 0), "utf-8");
      return { success: true, id };
  • The input schema definition for the 'add_class' tool, specifying parameters project_path (string), id (number), name (string), all required. Listed in the tools response.
      name: "add_class",
      description: "Add a new class to the database",
      inputSchema: {
        type: "object",
        properties: {
          project_path: {
            type: "string",
            description: "Path to the RPG Maker MZ project directory",
          },
          id: {
            type: "number",
            description: "Class ID",
          },
          name: {
            type: "string",
            description: "Class name",
          },
        },
        required: ["project_path", "id", "name"],
      },
    },
  • src/index.ts:1216-1223 (registration)
    The MCP tool call handler registration in the switch statement that extracts arguments, calls the addClass function, and returns the result as text content.
    case "add_class": {
      const projectPath = args.project_path as string;
      const id = args.id as number;
      const name = args.name as string;
      const result = await addClass(projectPath, id, name);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };

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/ShunsukeHayashi/rpgmaker-mz-mcp'

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