Skip to main content
Glama

update_database

Modify RPG Maker MZ database entries including Actors, Classes, Skills, Items, Weapons, and Armors by updating specific fields and values.

Instructions

Update an entry in any database (Actors, Classes, Skills, Items, Weapons, Armors, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name (e.g., 'Actors', 'Classes', 'Skills', 'Items')
idYesEntry ID
project_pathYesPath to the RPG Maker MZ project directory
updatesYesObject containing fields to update

Implementation Reference

  • The core handler function that reads a specific RPG Maker MZ database JSON file (e.g., Actors.json), updates the entry at the given ID with the provided updates, and writes it back.
    export async function updateDatabase( projectPath: string, database: string, id: number, updates: any ) { const dbPath = path.join(projectPath, "data", `${database}.json`); const dbContent = await fs.readFile(dbPath, "utf-8"); const data = JSON.parse(dbContent); if (!data[id]) { throw new Error(`${database} entry ${id} not found`); } Object.assign(data[id], updates); await fs.writeFile(dbPath, JSON.stringify(data, null, 0), "utf-8"); return { success: true }; }
  • The input schema and tool specification for the 'update_database' tool, defining parameters: project_path, database, id, and updates.
    { name: "update_database", description: "Update an entry in any database (Actors, Classes, Skills, Items, Weapons, Armors, etc.)", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the RPG Maker MZ project directory", }, database: { type: "string", description: "Database name (e.g., 'Actors', 'Classes', 'Skills', 'Items')", }, id: { type: "number", description: "Entry ID", }, updates: { type: "object", description: "Object containing fields to update", }, }, required: ["project_path", "database", "id", "updates"], }, },
  • src/index.ts:1246-1255 (registration)
    The registration and dispatch handler in the MCP server's CallToolRequestSchema that calls the updateDatabase function with parsed arguments and returns the result.
    case "update_database": { const projectPath = args.project_path as string; const database = args.database as string; const id = args.id as number; const updates = args.updates as any; const result = await updateDatabase(projectPath, database, id, updates); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }

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