Skip to main content
Glama

visum_health_check

Check the health and status of the VisumPy instance to ensure proper functionality and identify any issues.

Instructions

Check the health and status of the VisumPy instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary MCP tool registration and handler implementation for 'visum_health_check'. Calls controller health check and network stats methods, formats detailed health report.
    server.tool( "visum_health_check", "Check the health and status of the VisumPy instance", {}, async () => { try { // First check persistent process health const healthResult = await visumController.checkInstanceHealth(); const statsResult = await visumController.getNetworkStats(); if (statsResult.success && healthResult.success) { const nodes = statsResult.result?.nodes || 0; const isHealthy = nodes > 0; const isPersistent = statsResult.result?.persistent === true; const queryTime = statsResult.result?.query_time_ms || 0; const performance = queryTime < 50 ? 'Ultra-Veloce ๐Ÿš€' : queryTime < 200 ? 'Veloce โšก' : queryTime < 1000 ? 'Normale' : 'Lenta'; return { content: [ { type: "text", text: `${isHealthy ? '๐Ÿš€' : 'โš ๏ธ'} **Controllo Salute Istanza VisumPy PERSISTENTE**\n\n` + `**Stato:** ${isHealthy ? 'ATTIVO e PERSISTENTE โœ…' : 'Attenzione โš ๏ธ'}\n` + `**Performance:** ${performance}\n` + `**Tempo Query:** ${queryTime.toFixed(1)}ms\n` + `**Tempo Totale:** ${statsResult.executionTimeMs?.toFixed(3) || 'N/A'}ms\n` + `**Persistente:** ${isPersistent ? 'โœ… SรŒ' : 'โŒ NO'}\n\n` + `**Dettagli Istanza:**\n` + `โ€ข **Nodi Disponibili:** ${nodes.toLocaleString()}\n` + `โ€ข **Link Disponibili:** ${statsResult.result?.links?.toLocaleString() || 'N/A'}\n` + `โ€ข **Zone Disponibili:** ${statsResult.result?.zones?.toLocaleString() || 'N/A'}\n` + `โ€ข **Richieste Processate:** ${healthResult.result?.requestCount || 0}\n` + `โ€ข **Progetto Caricato:** ${healthResult.result?.projectLoaded ? 'โœ… SรŒ' : 'โŒ NO'}\n\n` + `*${isHealthy && isPersistent ? '๐Ÿš€ Istanza persistente pronta - Performance ultra-veloce garantita!' : 'Istanza potrebbe necessitare reinizializzazione'}*` } ] }; } else { return { content: [ { type: "text", text: `โŒ **Istanza VisumPy Non Sana**\n\n` + `L'istanza VisumPy non risponde o non รจ inizializzata.\n` + `Prova a eseguire visum_network_stats per inizializzare l'istanza.` } ] }; } } catch (error) { return { content: [ { type: "text", text: `โŒ **Errore controllo salute:**\n\n${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • Helper method getNetworkStats() called by the visum_health_check handler to retrieve ultra-fast network statistics from the persistent VisumPy instance.
    public async getNetworkStats(): Promise<VisumResponse> { const code = ` # Ultra-fast network statistics from persistent instance start_time = time.time() nodes = visum.Net.Nodes.Count links = visum.Net.Links.Count zones = visum.Net.Zones.Count elapsed = time.time() - start_time result = { 'nodes': nodes, 'links': links, 'zones': zones, 'query_time_ms': round(elapsed * 1000, 3), 'persistent': True } `; return this.sendCommandToPersistentProcess(code, "Network statistics (persistent)"); }
  • Core helper method checkInstanceHealth() that pings the persistent VisumPy process via stdin to verify instance health and responsiveness.
    public async checkInstanceHealth(): Promise<VisumResponse> { if (!this.isInstanceActive || !this.persistentProcess || this.persistentProcess.killed) { return { success: false, error: "Persistent process not running" }; } const requestId = (++this.requestCounter).toString(); return new Promise((resolve, reject) => { // Store the request this.pendingRequests.set(requestId, { resolve, reject }); // Send ping command const pingCommand = { type: 'ping', id: requestId, timestamp: Date.now() }; const commandJson = JSON.stringify(pingCommand) + '\n'; console.error(`๐Ÿฉบ Sending health check ${requestId}`); this.persistentProcess?.stdin?.write(commandJson); // Set timeout for ping setTimeout(() => { if (this.pendingRequests.has(requestId)) { this.pendingRequests.delete(requestId); resolve({ success: false, error: "Health check timeout" }); } }, 5000); // 5 second timeout for ping }); }
  • Tool name registration in server.tool call.
    "visum_health_check",
  • Empty input schema (no parameters required).
    {},

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

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