analyze_project_structure
Analyze RPG Maker MZ project structure to identify maps, connections, events, and game flow patterns for development insights.
Instructions
Analyze RPG Maker MZ project structure and provide insights about maps, connections, events, and game flow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the RPG Maker MZ project directory |
Implementation Reference
- src/index.ts:1018-1081 (handler)Handler implementation for the analyze_project_structure MCP tool. Analyzes RPG Maker MZ project by reading MapInfos.json, computing map counts, hierarchy based on parentId, total events, and events per map, then returns a markdown analysis report.case "analyze_project_structure": { const projectPath = args.project_path as string; let analysis = "# Project Structure Analysis\n\n"; try { const mapsFile = path.join(projectPath, "data", "MapInfos.json"); const mapsContent = await fs.readFile(mapsFile, "utf-8"); const maps = JSON.parse(mapsContent); const mapCount = Object.values(maps).filter((m) => m !== null).length; analysis += `## Overview\n- Total Maps: ${mapCount}\n\n`; analysis += "## Map Hierarchy\n"; for (const [id, mapInfo] of Object.entries(maps)) { if (mapInfo && typeof mapInfo === "object" && "name" in mapInfo) { const parentId = "parentId" in mapInfo ? mapInfo.parentId : 0; const indent = parentId === 0 ? "" : " "; analysis += `${indent}- ${mapInfo.name} (ID: ${id})\n`; } } analysis += "\n"; // Event analysis let totalEvents = 0; const eventsByMap: Record<string, number> = {}; for (const [id, mapInfo] of Object.entries(maps)) { if (mapInfo && typeof mapInfo === "object" && "name" in mapInfo) { try { const mapFile = path.join(projectPath, "data", `Map${String(id).padStart(3, "0")}.json`); const mapContent = await fs.readFile(mapFile, "utf-8"); const mapData = JSON.parse(mapContent); const eventCount = mapData.events?.filter((e: any) => e !== null).length || 0; totalEvents += eventCount; if (eventCount > 0) { eventsByMap[mapInfo.name as string] = eventCount; } } catch { // Skip } } } analysis += `## Event Statistics\n- Total Events: ${totalEvents}\n\n`; if (Object.keys(eventsByMap).length > 0) { analysis += "### Events by Map\n"; for (const [mapName, count] of Object.entries(eventsByMap)) { analysis += `- ${mapName}: ${count} events\n`; } } } catch (e) { analysis += "Error analyzing project structure\n"; } return { content: [ { type: "text", text: analysis, }, ], }; }
- src/index.ts:180-193 (registration)Tool registration entry in the MCP server's listTools response, defining the name, description, and input schema for analyze_project_structure.{ name: "analyze_project_structure", description: "Analyze RPG Maker MZ project structure and provide insights about maps, connections, events, and game flow", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, }, required: ["project_path"], }, },
- src/index.ts:183-192 (schema)Input schema definition for the analyze_project_structure tool, specifying the required project_path parameter.inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, }, required: ["project_path"], },