add_actor
Create new characters in RPG Maker MZ by adding actors to the game database with specified IDs and names for your project.
Instructions
Add a new actor to the database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Actor ID | |
| name | Yes | Actor name | |
| project_path | Yes | Path to the RPG Maker MZ project directory |
Implementation Reference
- src/game-creation-tools.ts:240-248 (handler)The core handler function that executes the add_actor tool logic: reads Actors.json, inserts default actor at given ID with name, writes back, returns success.export async function addActor(projectPath: string, id: number, name: string) { const actorsPath = path.join(projectPath, "data", "Actors.json"); const actorsContent = await fs.readFile(actorsPath, "utf-8"); const actors = JSON.parse(actorsContent); actors[id] = getDefaultActor(id, name); await fs.writeFile(actorsPath, JSON.stringify(actors, null, 0), "utf-8"); return { success: true, id }; }
- src/index.ts:1206-1214 (registration)MCP tool call handler registration: parses arguments and calls the addActor implementation function.case "add_actor": { const projectPath = args.project_path as string; const id = args.id as number; const name = args.name as string; const result = await addActor(projectPath, id, name); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:358-379 (schema)Tool schema definition in listTools response, specifying input parameters and validation for add_actor tool.{ name: "add_actor", description: "Add a new actor to the database", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, id: { type: "number", description: "Actor ID", }, name: { type: "string", description: "Actor name", }, }, required: ["project_path", "id", "name"], }, },
- src/index.ts:11-22 (registration)Import statement that brings the addActor handler into the MCP server scope.createNewProject, createMap, updateMapTile, addEvent, updateEvent, addEventCommand, addActor, addClass, addSkill, addItem, updateDatabase } from "./game-creation-tools.js";