add_skill
Add new skills to your RPG Maker MZ game database by specifying skill ID and name, enabling character abilities and combat mechanics development.
Instructions
Add a new skill to the database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Skill ID | |
| name | Yes | Skill name | |
| project_path | Yes | Path to the RPG Maker MZ project directory |
Implementation Reference
- src/game-creation-tools.ts:260-268 (handler)The core handler function that executes the add_skill tool logic by loading Skills.json, inserting a default skill at the given ID with the specified name using getDefaultSkill, and saving the file.export async function addSkill(projectPath: string, id: number, name: string) { const skillsPath = path.join(projectPath, "data", "Skills.json"); const skillsContent = await fs.readFile(skillsPath, "utf-8"); const skills = JSON.parse(skillsContent); skills[id] = getDefaultSkill(id, name); await fs.writeFile(skillsPath, JSON.stringify(skills, null, 0), "utf-8"); return { success: true, id }; }
- src/index.ts:402-423 (schema)Defines the input schema and metadata for the add_skill tool in the listTools response.{ name: "add_skill", description: "Add a new skill to the database", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, id: { type: "number", description: "Skill ID", }, name: { type: "string", description: "Skill name", }, }, required: ["project_path", "id", "name"], }, },
- src/index.ts:1226-1234 (registration)Registers the call handler for add_skill in the MCP server's CallToolRequestHandler switch statement, mapping tool arguments to the addSkill function call.case "add_skill": { const projectPath = args.project_path as string; const id = args.id as number; const name = args.name as string; const result = await addSkill(projectPath, id, name); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:11-21 (helper)Imports the addSkill handler function from game-creation-tools.js for use in the MCP server.createNewProject, createMap, updateMapTile, addEvent, updateEvent, addEventCommand, addActor, addClass, addSkill, addItem, updateDatabase