Skip to main content
Glama

onetech_extract_module

Extract domain models, pages, microflows, and enumerations from Mendix modules using mx.exe. Generates JSON documentation of complete module structure for local analysis.

Instructions

Extract domain model, pages, microflows, and enumerations from a Mendix module using mx.exe. Returns JSON files with complete module structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mprPathYesAbsolute path to the .mpr file (e.g., D:\Projects\OneTech.mpr)
moduleNameYesName of the module to extract (e.g., RequestHub)
outputPathYesAbsolute path to output directory for JSON files
mxPathNoOptional: Path to mx.exe (default: D:\Program Files\Mendix\11.3.0.80734\modeler\mx.exe)

Implementation Reference

  • Core implementation of the onetech_extract_module tool. Validates inputs, executes mx.exe dump-mpr for DomainModels, Pages, Microflows, and Enumerations, saves JSON outputs, removes BOM, computes sizes, handles partial failures, and returns structured result.
    async function extractModule(
    	mprPath: string,
    	moduleName: string,
    	outputPath: string,
    	mxPath: string = DEFAULT_MX_PATH
    ): Promise<{
    	success: boolean;
    	files: Array<{ name: string; size: number }>;
    	message: string;
    }> {
    	// Validate inputs
    	await validateMxExe(mxPath);
    	await validateMprFile(mprPath);
    	await ensureOutputDir(outputPath);
    
    	const files: Array<{ name: string; size: number }> = [];
    	const errors: string[] = [];
    
    	// Define the 4 mx.exe commands to extract module data
    	const commands = [
    		{
    			name: "DomainModel",
    			unitType: "DomainModels$DomainModel",
    			outputFile: join(outputPath, `${moduleName}-DomainModel.json`),
    		},
    		{
    			name: "Pages",
    			unitType: "Pages$Page",
    			outputFile: join(outputPath, `${moduleName}-Pages.json`),
    		},
    		{
    			name: "Microflows",
    			unitType: "Microflows$Microflow",
    			outputFile: join(outputPath, `${moduleName}-Microflows.json`),
    		},
    		{
    			name: "Enumerations",
    			unitType: "Enumerations$Enumeration",
    			outputFile: join(outputPath, `${moduleName}-Enumerations.json`),
    		},
    	];
    
    	// Execute each command sequentially
    	for (const cmd of commands) {
    		try {
    			const args = ["dump-mpr", "--unit-type", cmd.unitType, "--module-names", moduleName, "--output-file", cmd.outputFile, mprPath];
    
    			await runMxCommand(mxPath, args);
    
    			// Verify file was created and get size
    			let fileContent = await readFile(cmd.outputFile, "utf-8");
    			// Remove UTF-8 BOM if present (mx.exe outputs BOM)
    			if (fileContent.charCodeAt(0) === 0xfeff) {
    				fileContent = fileContent.substring(1);
    			}
    			files.push({
    				name: `${cmd.name}.json`,
    				size: Buffer.byteLength(fileContent, "utf-8"),
    			});
    		} catch (error: any) {
    			errors.push(`${cmd.name}: ${error.message}`);
    		}
    	}
    
    	// Return results
    	if (files.length === 0) {
    		return {
    			success: false,
    			files: [],
    			message: `Failed to extract module. Errors: ${errors.join(", ")}`,
    		};
    	}
    
    	if (errors.length > 0) {
    		return {
    			success: true,
    			files,
    			message: `Extracted ${files.length}/4 files successfully. Partial errors: ${errors.join(", ")}`,
    		};
    	}
    
    	return {
    		success: true,
    		files,
    		message: `Successfully extracted ${files.length} files from module '${moduleName}'`,
    	};
    }
  • JSON Schema defining the input parameters for the onetech_extract_module tool, including paths for MPR file, module name, output directory, and optional mx.exe path.
    inputSchema: {
    	type: "object",
    	properties: {
    		mprPath: {
    			type: "string",
    			description: "Absolute path to the .mpr file (e.g., D:\\Projects\\OneTech.mpr)",
    		},
    		moduleName: {
    			type: "string",
    			description: "Name of the module to extract (e.g., RequestHub)",
    		},
    		outputPath: {
    			type: "string",
    			description: "Absolute path to output directory for JSON files",
    		},
    		mxPath: {
    			type: "string",
    			description: `Optional: Path to mx.exe (default: ${DEFAULT_MX_PATH})`,
    		},
    	},
    	required: ["mprPath", "moduleName", "outputPath"],
    },
  • src/index.ts:199-230 (registration)
    Registration of the tool in the ListToolsRequestHandler, including name, description, and input schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
    	return {
    		tools: [
    			{
    				name: "onetech_extract_module",
    				description: "Extract domain model, pages, microflows, and enumerations from a Mendix module using mx.exe. Returns JSON files with complete module structure.",
    				inputSchema: {
    					type: "object",
    					properties: {
    						mprPath: {
    							type: "string",
    							description: "Absolute path to the .mpr file (e.g., D:\\Projects\\OneTech.mpr)",
    						},
    						moduleName: {
    							type: "string",
    							description: "Name of the module to extract (e.g., RequestHub)",
    						},
    						outputPath: {
    							type: "string",
    							description: "Absolute path to output directory for JSON files",
    						},
    						mxPath: {
    							type: "string",
    							description: `Optional: Path to mx.exe (default: ${DEFAULT_MX_PATH})`,
    						},
    					},
    					required: ["mprPath", "moduleName", "outputPath"],
    				},
    			},
    		],
    	};
    });
  • src/index.ts:235-277 (registration)
    Tool dispatch and execution handler in CallToolRequestHandler. Matches tool name, extracts arguments, calls extractModule, formats response or error.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
    	if (request.params.name === "onetech_extract_module") {
    		const { mprPath, moduleName, outputPath, mxPath } = request.params.arguments as {
    			mprPath: string;
    			moduleName: string;
    			outputPath: string;
    			mxPath?: string;
    		};
    
    		try {
    			const result = await extractModule(mprPath, moduleName, outputPath, mxPath || DEFAULT_MX_PATH);
    
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(result, null, 2),
    					},
    				],
    			};
    		} catch (error: any) {
    			return {
    				content: [
    					{
    						type: "text",
    						text: JSON.stringify(
    							{
    								success: false,
    								files: [],
    								message: `Error: ${error.message}`,
    							},
    							null,
    							2
    						),
    					},
    				],
    				isError: true,
    			};
    		}
    	}
    
    	throw new Error(`Unknown tool: ${request.params.name}`);
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool uses 'mx.exe' and returns JSON files, but it lacks details on permissions, side effects, error handling, or performance aspects. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is a single, well-structured sentence that efficiently conveys the tool's purpose, method, and output. It is front-loaded with key information and avoids unnecessary details, making it highly concise and effective for quick comprehension.

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

Completeness3/5

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

Given the lack of annotations and output schema, the description provides basic context but is incomplete. It covers the tool's action and output format but misses behavioral details and return value specifics. For a tool with 4 parameters and no structured output, more information would improve completeness.

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?

The schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description does not add any additional meaning or context beyond what the schema provides, such as usage examples or constraints. This meets the baseline for high schema coverage but does not enhance parameter understanding.

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

Purpose5/5

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

The description clearly states the action ('Extract'), the target resources ('domain model, pages, microflows, and enumerations'), and the tool used ('mx.exe'). It specifies the scope ('from a Mendix module') and the output format ('JSON files with complete module structure'), making the purpose specific and comprehensive without relying on sibling tools for differentiation.

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

Usage Guidelines3/5

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

The description implies usage for extracting module components in Mendix projects, but it does not provide explicit guidance on when to use this tool versus alternatives, prerequisites, or exclusions. With no sibling tools, the context is straightforward, but the lack of detailed guidelines limits its effectiveness for complex decision-making.

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/jordnlvr/onetech-mcp-server'

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