project_instances_status
Check the current operational status of all active project instances to monitor progress and identify issues requiring attention.
Instructions
Get status of all active project instances
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index-backup.ts:871-924 (registration)Registration and inline handler for the 'project_instances_status' MCP tool. Calls projectManager.getInstancesStatus() and formats the output as a status report.server.tool( "project_instances_status", "Get status of all active project instances", {}, async () => { try { const status = projectManager.getInstancesStatus(); const instanceCount = Object.keys(status).length; if (instanceCount === 0) { return { content: [ { type: "text", text: `š **Status Istanze Progetto**\n\nā Nessuna istanza attiva.` } ] }; } let statusText = `š **Status Istanze Progetto** (${instanceCount} attive)\n\n`; for (const [projectId, info] of Object.entries(status)) { const uptime = Math.floor((info.uptime || 0) / 1000); const lastUsed = info.lastUsed ? Math.floor((Date.now() - info.lastUsed) / 1000) : 'Mai'; statusText += `š§ **${info.name}**\n`; statusText += ` ⢠ID: ${projectId}\n`; statusText += ` ⢠Status: ${info.isActive ? 'ā Attiva' : 'ā Inattiva'}\n`; statusText += ` ⢠Uptime: ${uptime}s\n`; statusText += ` ⢠Ultimo uso: ${lastUsed}s fa\n`; statusText += ` ⢠Network: ${info.stats?.nodes} nodi, ${info.stats?.links} link\n\n`; } return { content: [ { type: "text", text: statusText } ] }; } catch (error) { return { content: [ { type: "text", text: `ā **Errore:** ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- src/project-instance-manager.ts:191-207 (handler)Core helper method implementing getInstancesStatus() in ProjectInstanceManager class. Iterates over active project instances and returns their status objects with uptime and stats.public getInstancesStatus(): { [projectId: string]: any } { const status: { [projectId: string]: any } = {}; for (const [projectId, instance] of this.projectInstances) { status[projectId] = { name: instance.config.name, description: instance.config.description, isActive: instance.isActive, startTime: instance.startTime, lastUsed: instance.lastUsed, uptime: instance.startTime ? Date.now() - instance.startTime : 0, stats: instance.stats }; } return status; }