Skip to main content
Glama

extract_game_design_patterns

Extract common game design patterns from RPG Maker MZ projects, including event patterns and map layouts, to analyze and understand project structure.

Instructions

Extract common game design patterns from the project (event patterns, map layouts, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYesPath to the RPG Maker MZ project directory

Implementation Reference

  • The main handler function for the 'extract_game_design_patterns' tool. It reads all maps from the project, iterates through all events and their command lists, counts occurrences of each event command code, and returns the top 10 most common commands as game design patterns.
    case "extract_game_design_patterns": { const projectPath = args.project_path as string; let patterns = "# Game Design Patterns\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 eventPatterns: Record<string, number> = {}; const commonEventCommands: 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); if (mapData.events) { for (const event of mapData.events) { if (event && event.pages) { for (const page of event.pages) { if (page.list) { for (const command of page.list) { const cmdCode = command.code; commonEventCommands[cmdCode] = (commonEventCommands[cmdCode] || 0) + 1; } } } } } } } catch { // Skip } } } patterns += "## Common Event Commands\n"; const sortedCommands = Object.entries(commonEventCommands) .sort(([, a], [, b]) => b - a) .slice(0, 10); for (const [code, count] of sortedCommands) { patterns += `- Command ${code}: ${count} occurrences\n`; } } catch (e) { patterns += "Error extracting patterns\n"; } return { content: [ { type: "text", text: patterns, }, ], }; }
  • src/index.ts:194-207 (registration)
    Tool registration in the list of available tools, including name, description, and input schema definition.
    { name: "extract_game_design_patterns", description: "Extract common game design patterns from the project (event patterns, map layouts, etc.)", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, }, required: ["project_path"], }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ShunsukeHayashi/rpgmaker-mz-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server