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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_tomcat_status"
}
}Input 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 schema
server.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 command
getStatus() { 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 uptime
getUptime() { 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`; } }