generate_project_context
Generate comprehensive documentation for RPG Maker MZ projects including structure, maps, events, and plugin information to understand project organization and dependencies.
Instructions
Generate comprehensive context documentation for an RPG Maker MZ project including structure, maps, events, and plugin information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_events | No | Include event data (default: true) | |
| include_maps | No | Include detailed map information (default: true) | |
| include_plugins | No | Include plugin information (default: true) | |
| project_path | Yes | Path to the RPG Maker MZ project directory |
Implementation Reference
- src/index.ts:154-179 (registration)Registration of the generate_project_context tool in the MCP server's listTools handler, defining the tool name, description, and input schema for project path and optional flags for including maps, events, and plugins.{ name: "generate_project_context", description: "Generate comprehensive context documentation for an RPG Maker MZ project including structure, maps, events, and plugin information", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, include_maps: { type: "boolean", description: "Include detailed map information (default: true)", }, include_events: { type: "boolean", description: "Include event data (default: true)", }, include_plugins: { type: "boolean", description: "Include plugin information (default: true)", }, }, required: ["project_path"], }, },
- src/index.ts:157-176 (schema)Input schema definition for the generate_project_context tool, specifying parameters for project_path (required) and optional booleans for including maps, events, and plugins.inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, include_maps: { type: "boolean", description: "Include detailed map information (default: true)", }, include_events: { type: "boolean", description: "Include event data (default: true)", }, include_plugins: { type: "boolean", description: "Include plugin information (default: true)", }, },
- src/index.ts:933-1016 (handler)The handler implementation in the callTool request handler. It reads key project files (Game.rpgproject, System.json, MapInfos.json, individual map JSONs, js/plugins directory), compiles a structured Markdown report summarizing project information, system settings, list of maps with event counts (if enabled), and list of plugins (if enabled), then returns it as text content.case "generate_project_context": { const projectPath = args.project_path as string; const includeMaps = args.include_maps !== false; const includeEvents = args.include_events !== false; const includePlugins = args.include_plugins !== false; let context = "# RPG Maker MZ Project Context\n\n"; // Project info try { const projectFile = path.join(projectPath, "Game.rpgproject"); const projectContent = await fs.readFile(projectFile, "utf-8"); context += "## Project Information\n```\n" + projectContent + "\n```\n\n"; } catch (e) { context += "## Project Information\nUnavailable\n\n"; } // System data try { const systemFile = path.join(projectPath, "data", "System.json"); const systemContent = await fs.readFile(systemFile, "utf-8"); const system = JSON.parse(systemContent); context += "## System Settings\n"; context += `- Game Title: ${system.gameTitle}\n`; context += `- Version: ${system.versionId || "N/A"}\n\n`; } catch (e) { // Skip if unavailable } // Maps if (includeMaps) { try { const mapsFile = path.join(projectPath, "data", "MapInfos.json"); const mapsContent = await fs.readFile(mapsFile, "utf-8"); const maps = JSON.parse(mapsContent); context += "## Maps\n"; for (const [id, mapInfo] of Object.entries(maps)) { if (mapInfo && typeof mapInfo === "object" && "name" in mapInfo) { context += `- Map ${id}: ${mapInfo.name}\n`; if (includeEvents) { 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; context += ` - Events: ${eventCount}\n`; } catch { // Skip if map file unavailable } } } } context += "\n"; } catch (e) { context += "## Maps\nUnavailable\n\n"; } } // Plugins if (includePlugins) { try { const pluginsDir = path.join(projectPath, "js", "plugins"); const files = await fs.readdir(pluginsDir); const pluginFiles = files.filter((f) => f.endsWith(".js")); context += "## Plugins\n"; for (const plugin of pluginFiles) { context += `- ${plugin}\n`; } context += "\n"; } catch (e) { context += "## Plugins\nUnavailable\n\n"; } } return { content: [ { type: "text", text: context, }, ], }; }