Skip to main content
Glama

Visum Thinker MCP Server

MIT License
test-export-links.json•2.94 kB
{ "method": "tools/call", "params": { "name": "project_execute", "arguments": { "projectId": "S000009result_1278407893", "code": "import os\nimport csv\nimport xml.etree.ElementTree as ET\n\nresult = {}\n\ntry:\n ver_path = visum.GetPath(1)\n project_dir = os.path.dirname(ver_path)\n project_name = os.path.splitext(os.path.basename(ver_path))[0]\n lay_file = os.path.join(project_dir, 'tabelle_report.lay')\n \n tree = ET.parse(lay_file)\n root = tree.getroot()\n \n for list_item in root.iter('listLayoutItem'):\n graphic = list_item.find('.//listGraphicParameterLayoutItems')\n if graphic is None:\n continue\n \n net_type = graphic.get('netObjectType', '')\n if net_type != 'LINK':\n continue\n \n # Get all columns\n all_columns = []\n for attr_def in list_item.iter('attributeDefinition'):\n attr_id = attr_def.get('attributeID')\n if attr_id:\n all_columns.append(attr_id)\n \n result['total_columns'] = len(all_columns)\n \n # Filter valid columns\n links = visum.Net.Links\n valid_columns = []\n \n for col in all_columns:\n try:\n test = links.GetMultipleAttributes([col])\n if test:\n valid_columns.append(col)\n except:\n pass\n \n result['valid_columns'] = len(valid_columns)\n result['columns'] = valid_columns\n \n # Get data for valid columns\n if valid_columns:\n export_data = links.GetMultipleAttributes(valid_columns)\n \n # Write CSV\n csv_file = os.path.join(project_dir, project_name + '_Links.csv')\n \n with open(csv_file, 'w', newline='', encoding='utf-8') as f:\n writer = csv.writer(f, delimiter=';')\n writer.writerow(valid_columns)\n \n num_rows = len(export_data[0]) if export_data else 0\n max_rows = min(1000, num_rows)\n \n for row_idx in range(max_rows):\n row = []\n for col_idx in range(len(valid_columns)):\n row.append(export_data[col_idx][row_idx])\n writer.writerow(row)\n \n result['file'] = os.path.basename(csv_file)\n result['rows'] = max_rows\n result['size_kb'] = round(os.path.getsize(csv_file) / 1024, 2)\n \n result['status'] = 'SUCCESS'\n break\n\nexcept Exception as e:\n result['status'] = 'ERROR'\n result['error'] = str(e)\n import traceback\n result['traceback'] = traceback.format_exc()\n\nresult", "description": "Export Links table to CSV" } }, "jsonrpc": "2.0", "id": 10 }

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