inspect_database_schema
Retrieve column structure of a database table to understand how Mendix stores data. Use this tool to analyze local project database schemas for development and debugging.
Instructions
Geeft de kolomstructuur van een tabel in de lokale database terug. Handig om te begrijpen hoe Mendix data opslaat.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | No | Naam van de tabel (standaard: Unit) | Unit |
Implementation Reference
- src/server.ts:82-95 (registration)Tool registration in ListTools handler, including name, description, and input schema for 'table_name' parameter.{ name: "inspect_database_schema", description: "Geeft de kolomstructuur van een tabel in de lokale database terug. Handig om te begrijpen hoe Mendix data opslaat.", inputSchema: { type: "object", properties: { table_name: { type: "string", description: "Naam van de tabel (standaard: Unit)", default: "Unit" } } } }
- src/server.ts:85-95 (schema)Input schema definition for the inspect_database_schema tool.inputSchema: { type: "object", properties: { table_name: { type: "string", description: "Naam van de tabel (standaard: Unit)", default: "Unit" } } } }
- src/mprReader.ts:168-183 (helper)MprReader.getSchema() method provides the core logic for retrieving database table schema via SQLite PRAGMA table_info, directly matching the tool's intended functionality.* Inspects the schema of the 'Unit' table (or any other table). * Useful for debugging internal Mendix structure. */ getSchema(tableName: string = 'Unit'): any[] { if (!this.db) { throw new Error('Database not connected.'); } try { // Use SQLite pragma to get table info const stmt = this.db.prepare(`PRAGMA table_info(${tableName})`); return stmt.all(); } catch (error) { console.error(`Error getting schema for ${tableName}:`, error); return []; } }