Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool handler implementation in handleToolCall switch statement, delegates to processManager.getStatus()
    case "get_tomcat_status": return processManager.getStatus();
  • 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 }; });
  • 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' }; }
  • 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`; } }

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/lkb2k/mcp-gradle'

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