Skip to main content
Glama

create_map

Create a new map in your RPG Maker MZ project by specifying map ID, name, and dimensions to build game worlds and environments.

Instructions

Create a new map in the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
heightNoMap height in tiles (default: 13)
map_idYesMap ID number
nameYesMap name
project_pathYesPath to the RPG Maker MZ project directory
widthNoMap width in tiles (default: 17)

Implementation Reference

  • Core handler function that executes the map creation logic: validates parameters, updates MapInfos.json with new map info, generates default map data, and writes the new MapXXX.json file.
    export async function createMap(projectPath: string, mapId: number, name: string, width = 17, height = 13) { try { // Validate inputs await validateProjectPath(projectPath); Validator.requirePositiveNumber(mapId, "map_id"); Validator.requireString(name, "name"); Validator.requirePositiveNumber(width, "width"); Validator.requirePositiveNumber(height, "height"); await Logger.info("Creating map", { projectPath, mapId, name, width, height }); // Read MapInfos const mapInfosPath = path.join(projectPath, "data", "MapInfos.json"); const mapInfos = await FileHelper.readJSON(mapInfosPath); // Add new map info mapInfos[mapId] = getDefaultMapInfo(mapId, name); await FileHelper.writeJSON(mapInfosPath, mapInfos); // Create map file const map = getDefaultMap(mapId, name, width, height); const mapFilename = `Map${String(mapId).padStart(3, "0")}.json`; await FileHelper.writeJSON(path.join(projectPath, "data", mapFilename), map); await Logger.info("Map created successfully", { mapId, name }); return { success: true, mapId, name }; } catch (error) { await Logger.error("Failed to create map", { projectPath, mapId, name, error }); return createErrorResponse(error); } }
  • Tool schema definition including name, description, and input schema for the 'create_map' MCP tool, used in ListTools response.
    name: "create_map", description: "Create a new map in the project", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, map_id: { type: "number", description: "Map ID number", }, name: { type: "string", description: "Map name", }, width: { type: "number", description: "Map width in tiles (default: 17)", }, height: { type: "number", description: "Map height in tiles (default: 13)", }, }, required: ["project_path", "map_id", "name"], }, },
  • MCP CallTool request handler for 'create_map': extracts arguments from request, calls the core createMap function, and returns the result as text content.
    case "create_map": { const projectPath = args.project_path as string; const mapId = args.map_id as number; const name = args.name as string; const width = (args.width as number) || 17; const height = (args.height as number) || 13; const result = await createMap(projectPath, mapId, name, width, height); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
  • Import statement that brings the createMap helper function into the MCP server scope.
    createNewProject, createMap, updateMapTile,

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