Skip to main content
Glama

Visum Thinker MCP Server

MIT License
test-analyze-layout-file.jsonβ€’2.96 kB
{"method":"tools/call","params":{"name":"project_execute","arguments":{"projectId":"S000009result_1278407893","code":"# Cerca se il layout caricato contiene informazioni sulle tabelle\nimport os\nresult = {}\ntry:\n # 1. Il Global Layout caricato potrebbe essere accessibile\n # Verifica metodi per ottenere il layout corrente\n visum_attrs = [a for a in dir(visum) if not a.startswith('_')]\n layout_attrs = [a for a in visum_attrs if 'Layout' in a or 'Current' in a or 'Active' in a]\n result['layout_related_attrs'] = layout_attrs[:20]\n \n # 2. Alternativa: Il file .lay Γ¨ un file XML/testo che possiamo leggere\n # Verifica se il file tabelle_report.lay Γ¨ leggibile\n project_path = visum.GetPath(1)\n project_dir = os.path.dirname(project_path)\n lay_file = os.path.join(project_dir, 'tabelle_report.lay')\n \n if os.path.exists(lay_file):\n result['lay_file_exists'] = True\n result['lay_file_size'] = os.path.getsize(lay_file)\n \n # Prova a leggere prime righe per vedere il formato\n try:\n with open(lay_file, 'rb') as f:\n # Leggi primi 500 bytes\n header = f.read(500)\n # Prova a decodificare\n try:\n header_text = header.decode('utf-8')\n result['file_format'] = 'text/xml'\n result['header_preview'] = header_text[:200]\n except:\n # Probabilmente binario\n result['file_format'] = 'binary'\n result['header_hex'] = header[:50].hex()\n except Exception as e:\n result['read_error'] = str(e)\n \n # 3. Approccio pragmatico: esporta le tabelle piΓΉ comuni usate in analisi\n # Liste tabelle standard che l'utente probabilmente vuole\n common_tables = [\n 'Zones', 'Nodes', 'Links', 'Turns', 'Connectors',\n 'Lines', 'LineRoutes', 'TimeProfiles', 'VehicleJourneys',\n 'DemandSegments', 'Matrices', 'ODPairs'\n ]\n \n # Verifica quali esistono e hanno dati\n available_tables = []\n if hasattr(visum, 'Net'):\n net = visum.Net\n for table_name in common_tables:\n if hasattr(net, table_name):\n try:\n collection = getattr(net, table_name)\n if hasattr(collection, 'Count'):\n count = collection.Count\n if count > 0:\n available_tables.append({\n 'name': table_name,\n 'count': count\n })\n except:\n pass\n \n result['available_common_tables'] = available_tables\n \nexcept Exception as e:\n result['error'] = str(e)\nresult","description":"Analizza layout file e cerca tabelle comuni"}},"jsonrpc":"2.0","id":20}

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