get_tomcat_status
Check the current status of the Tomcat process to monitor its operational state and ensure proper functionality.
Instructions
Check Tomcat process status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.js:123-125 (handler)Tool handler implementation in handleToolCall switch statement, delegates to processManager.getStatus()case "get_tomcat_status": return processManager.getStatus();
- src/tools/index.js:52-59 (schema)Tool definition including name, description, and empty input schema (no parameters required){ name: "get_tomcat_status", description: "Check Tomcat process status", inputSchema: { type: "object", properties: {} } },
- src/server.js:47-51 (registration)MCP tool registration via ListToolsRequestHandler, exposes TOOLS array containing get_tomcat_status schemaserver.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS }; });
- src/process-manager.js:111-129 (helper)ProcessManager.getStatus() method providing the core logic for checking Tomcat status: running state, PID, uptime, port, and Gradle commandgetStatus() { if (!this.process) { return { running: false, pid: null, uptime: null, port: null, gradle_command: null }; } return { running: true, pid: this.process.pid, uptime: this.getUptime(), port: this.config.port || null, gradle_command: this.config.gradleCommand || 'appRun' }; }
- src/process-manager.js:131-147 (helper)Supporting getUptime() utility method used by getStatus() to format process uptimegetUptime() { if (!this.startTime) return null; const now = new Date(); const diff = now - this.startTime; const seconds = Math.floor(diff / 1000); const minutes = Math.floor(seconds / 60); const hours = Math.floor(minutes / 60); if (hours > 0) { return `${hours}h ${minutes % 60}m ${seconds % 60}s`; } else if (minutes > 0) { return `${minutes}m ${seconds % 60}s`; } else { return `${seconds}s`; } }