Skip to main content
Glama

Visum Thinker MCP Server

MIT License
test-global-layouts-direct.js•4.7 kB
// Test diretto: apri progetto S000009result.ver e lista Global Layouts import { ProjectServerManager } from './build/project-server-manager.js'; const serverManager = ProjectServerManager.getInstance(); async function testGlobalLayouts() { try { console.log('šŸ“‚ Apertura progetto S000009result.ver...\n'); // 1. Apri il progetto const openResult = await serverManager.openProject('H:\\go\\reports\\Input\\S000009result.ver'); if (!openResult.success) { console.error('āŒ Errore apertura progetto:', openResult.message); return; } console.log('āœ… Progetto aperto!'); console.log(` Project ID: ${openResult.projectId}`); console.log(` Porta TCP: ${openResult.serverInfo.port}`); console.log(` PID: ${openResult.serverInfo.pid}\n`); // Aspetta che il server sia completamente pronto console.log('ā³ Attendo inizializzazione completa (10 secondi)...\n'); await new Promise(resolve => setTimeout(resolve, 10000)); // 2. Lista Global Layouts console.log('šŸ“‹ Richiesta lista Global Layouts...\n'); const pythonCode = ` gls = None result = { 'count': 0, 'layouts': [], 'error': None } try: # Tenta accesso a GlobalLayouts try: gls = Visum.Net.Project.GlobalLayouts except Exception: try: gls = Visum.Project.GlobalLayouts except Exception: gls = None if gls is None: result['error'] = 'GlobalLayouts collection not accessible' else: count = gls.Count if count == 0: result['count'] = 0 result['layouts'] = [] else: attrs = ['No','Name','GlobalLayoutFile','GlobalLayoutFileVersionNo'] data = gls.GetMultipleAttributes(attrs) layouts = [] # Assume data is columnar: [[no1,no2,...], [name1,name2,...], ...] if isinstance(data, (list, tuple)) and len(data) == len(attrs): for i in range(count): row = [data[a][i] for a in range(len(attrs))] layouts.append({ 'no': row[0], 'name': row[1], 'file': row[2] if row[2] else '(not associated)', 'version': row[3] if row[3] else 'N/A', 'associated': bool(row[2]) }) result['count'] = len(layouts) result['layouts'] = layouts assoc = sum(1 for l in layouts if l['associated']) result['summary'] = { 'associated_layouts': assoc, 'unassociated_layouts': len(layouts) - assoc } except Exception as e: result['error'] = str(e) result `; const response = await serverManager.executeCommand( openResult.projectId, pythonCode, 'List Global Layouts' ); if (response.type === 'error') { console.error('āŒ Errore esecuzione:', response.message); return; } const result = response.result || {}; if (result.error) { console.log(`āš ļø Errore: ${result.error}\n`); } else { console.log('āœ… Global Layouts trovati!\n'); console.log(`šŸ“Š Totale: ${result.count}`); if (result.summary) { console.log(` Associati: ${result.summary.associated_layouts}`); console.log(` Non associati: ${result.summary.unassociated_layouts}\n`); } if (result.count > 0) { console.log('šŸ“‹ Lista:\n'); result.layouts.forEach((layout, idx) => { console.log(`${idx + 1}. Layout #${layout.no}`); console.log(` Nome: ${layout.name || '(senza nome)'}`); console.log(` File: ${layout.file}`); console.log(` Versione: ${layout.version}`); console.log(` Associato: ${layout.associated ? 'āœ…' : 'āŒ'}\n`); }); } else { console.log('ā„¹ļø Nessun Global Layout nel progetto\n'); } } // 3. Chiudi il progetto console.log('šŸ”š Chiusura progetto...'); await serverManager.closeProject(openResult.projectId, false); console.log('āœ… Test completato!\n'); } catch (error) { console.error('āŒ Errore:', error.message); } finally { process.exit(0); } } testGlobalLayouts();

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/multiluca2020/visum-thinker-mcp-server'

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