upgrade_contam_project
Convert older CONTAM project files to newer formats using the prjup utility, maintaining compatibility for airflow and contaminant transport simulations.
Instructions
Use this when you need to upgrade an older .prj file to a newer CONTAM project format using prjup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | ||
| targetVersion | No | ||
| createBackup | No | ||
| timeoutSeconds | No |
Implementation Reference
- contam-mcp/src/server.js:2816-2860 (handler)The tool "upgrade_contam_project" is registered and implemented in contam-mcp/src/server.js using the 'prjup' executable to upgrade CONTAM project files.
"upgrade_contam_project", "Use this when you need to upgrade an older .prj file to a newer CONTAM project format using prjup.", { projectPath: z.string(), targetVersion: z.string().optional(), createBackup: z.boolean().optional(), timeoutSeconds: z.number().int().min(1).max(600).optional() }, async ({ projectPath, targetVersion, createBackup, timeoutSeconds }) => { const executablePath = await resolveExecutable("prjup"); const resolvedProjectPath = asAbsolutePath(projectPath); if (!(await fileExists(resolvedProjectPath))) { throw new Error(`Project file not found: ${resolvedProjectPath}`); } const projectDirectory = path.dirname(resolvedProjectPath); const before = await snapshotDirectory(projectDirectory); const args = [resolvedProjectPath]; if (createBackup === false) { args.push("-n"); } if (targetVersion) { args.push(`--projectversion=${targetVersion}`); } const result = await runProcess(executablePath, args, { cwd: projectDirectory, timeoutSeconds: timeoutSeconds ?? 60 }); const after = await snapshotDirectory(projectDirectory); return toolResponse( result.ok ? "prjup completed successfully." : "prjup finished with errors or a non-zero exit code.", { executablePath, projectPath: resolvedProjectPath, args, ...result, fileChanges: diffSnapshots(before, after) } ); } );