Skip to main content
Glama
garuh143

RPG Maker MZ/MV MCP Server

by garuh143

add_event_command

Add commands to RPG Maker event pages to control game logic, dialogue, and interactions within maps.

Instructions

Add a command to an event page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mapIdYes
eventIdYes
pageIndexYes
commandYes
positionNo

Implementation Reference

  • The implementation of the addEventCommand function which adds a command to an event page in an RPG Maker map.
    export async function addEventCommand(
      projectPath: string,
      mapId: number,
      eventId: number,
      pageIndex: number,
      command: EventCommand,
      position?: number
    ): Promise<MapEvent> {
      const map = await getMap(projectPath, mapId);
    
      if (!map.events[eventId]) {
        throw new Error(`Event ${eventId} not found on map ${mapId}`);
      }
    
      const event = map.events[eventId]!;
    
      if (!event.pages[pageIndex]) {
        throw new Error(`Page ${pageIndex} not found on event ${eventId}`);
      }
    
      const commandList = event.pages[pageIndex].list;
    
      if (position !== undefined && position >= 0 && position < commandList.length - 1) {
        // Insert at specific position (before the end command)
        commandList.splice(position, 0, command);
      } else {
        // Add before the end command (code 0)
        commandList.splice(commandList.length - 1, 0, command);
      }
    
      const mapPath = getMapPath(projectPath, mapId);
      await writeJsonFile(mapPath, map);
    
      return event;
    }
  • src/index.ts:452-475 (registration)
    Registration of the add_event_command tool in the MCP tool list.
      name: 'add_event_command',
      description: 'Add a command to an event page',
      inputSchema: {
        type: 'object',
        properties: {
          mapId: { type: 'number' },
          eventId: { type: 'number' },
          pageIndex: { type: 'number' },
          command: {
            type: 'object',
            properties: {
              code: { type: 'number' },
              indent: { type: 'number' },
              parameters: { type: 'array' },
            },
          },
          position: { type: 'number' },
        },
        required: ['mapId', 'eventId', 'pageIndex', 'command'],
      },
    },
    {
      name: 'create_map',
      description: 'Create a new map with specified dimensions and properties. Returns the new map ID and map data.',
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 discloses no behavioral traits. It does not state whether this operation is destructive, what happens if the position parameter is excluded (likely appends to end), or the expected format of the command code integers.

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

Conciseness3/5

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

While not verbose, the single 6-word sentence is inappropriately brief for a tool with nested objects and zero schema documentation. It is front-loaded but underspecified for the complexity level.

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 the high complexity (5 parameters, nested command object, mutation operation, no output schema), the description is grossly incomplete. It fails to explain the domain model (RPG Maker-style event commands), return values, or error conditions.

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

Parameters1/5

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

With 0% schema description coverage, the description must compensate by explaining the 5 parameters, especially the nested 'command' object structure (code, indent, parameters) and the 'position' insertion point. It mentions none of these, leaving all parameters effectively undocumented.

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

Purpose3/5

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

States the basic action (add) and target (command on event page), providing minimal viable clarity. However, it fails to differentiate from sibling 'update_map_event' or explain what constitutes a 'command' in this game development context.

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?

Provides no guidance on when to use this tool versus 'update_map_event' or 'create_map_event'. Does not mention prerequisites (e.g., requiring an existing event page) or insertion behavior when the optional 'position' parameter is omitted.

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/garuh143/RPG-MakerMV-MCP'

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