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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Class ID | |
| name | Yes | Class name | |
| project_path | Yes | Path to the RPG Maker MZ project directory |
Implementation Reference
- src/game-creation-tools.ts:250-257 (handler)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 };
- src/index.ts:381-401 (schema)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) }], };