Skip to main content
Glama

project_health_check

Check the operational status of a specific project instance to identify issues and ensure proper functionality.

Instructions

Check health of specific project instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier to check health for

Implementation Reference

  • MCP tool registration for 'project_health_check', including schema (projectId string) and thin async handler that calls projectManager.checkProjectHealth(projectId) and formats response.
    server.tool( "project_health_check", "Check health of specific project instance", { projectId: z.string().describe("Project identifier to check health for") }, async ({ projectId }) => { try { const result = await projectManager.checkProjectHealth(projectId); if (result.success) { const health = result.health; const uptime = Math.floor((health.uptime || 0) / 1000); return { content: [ { type: "text", text: `šŸ’š **Health Check - ${health.projectName}**\n\nāœ… **Status:** Salutare\nšŸ”„ **Uptime:** ${uptime}s\n⚔ **Performance:** ${health.response_time_ms}ms\nšŸ“Š **Memory Usage:** ${health.memory_mb}MB\nšŸ“‚ **Progetto Caricato:** ${health.project_loaded ? 'āœ…' : 'āŒ'}\nšŸ”— **Network:** ${health.network_ready ? 'āœ…' : 'āŒ'}` } ] }; } else { return { content: [ { type: "text", text: `āŒ **Health Check Fallito**\n\n${result.error}` } ] }; } } catch (error) { return { content: [ { type: "text", text: `āŒ **Errore:** ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • Core handler logic in ProjectInstanceManager.checkProjectHealth: retrieves project instance, calls controller.checkInstanceHealth, aggregates with project-specific info like uptime, name.
    public async checkProjectHealth(projectId: string): Promise<{ success: boolean; health?: any; error?: string; }> { const instance = this.projectInstances.get(projectId); if (!instance || !instance.isActive) { return { success: false, error: `Project instance ${projectId} not active` }; } try { const healthResult = await instance.controller.checkInstanceHealth(); return { success: healthResult.success, health: { ...healthResult.result, projectName: instance.config.name, uptime: Date.now() - (instance.startTime || Date.now()), lastUsed: instance.lastUsed }, error: healthResult.error }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } }
  • Supporting health check in PersistentVisumController: sends 'ping' JSON command to persistent Python VisumPy process via stdin, awaits 'pong' response with stats like requestCount, projectLoaded.
    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 }); }

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