Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_pathYesPath to the RPG Maker MZ project directory

Implementation Reference

  • 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"],
      },
    },
  • 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"],
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral details. It mentions 'provide insights' but doesn't disclose output format, depth of analysis, performance considerations, or error handling. For a tool with no annotations and unknown output, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids redundancy and stays focused, though it could be slightly more structured by separating insights into a list for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a single parameter with full schema coverage, the description is incomplete. It doesn't explain what 'insights' entail, how results are returned, or any limitations, making it inadequate for an analysis tool where output understanding is critical.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter 'project_path', so the schema already documents it adequately. The description adds no additional parameter semantics beyond what's in the schema, such as path format examples or validation rules, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('analyze') and resource ('RPG Maker MZ project structure'), with specific insights mentioned (maps, connections, events, game flow). It distinguishes from siblings like 'analyze_assets' by focusing on project structure rather than assets, but doesn't explicitly contrast with 'read_project_info' or 'generate_project_context' which might overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'read_project_info', 'generate_project_context', or 'list_maps'. The description implies analysis for insights, but doesn't specify prerequisites, timing, or exclusions, leaving the agent to guess based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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