restart_tomcat
Restarts Tomcat server processes for Gradle-based applications, allowing controlled stop and start operations with optional force termination. Simplifies server management in development environments.
Instructions
Stop and start Tomcat
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Force termination during stop | |
| gradle_command | No | Gradle command for restart (default: appRun) |
Implementation Reference
- src/process-manager.js:97-109 (handler)The main handler function that implements restarting Tomcat by stopping the current process and starting a new one.async restartTomcat(force = false, gradleCommand = null) { const stopResult = await this.stopTomcat(force); await new Promise(resolve => setTimeout(resolve, 2000)); const startResult = await this.startTomcat(gradleCommand); return { stop: stopResult, start: startResult, success: true }; }
- src/tools/index.js:37-49 (schema)Input schema defining parameters for the restart_tomcat tool: force (boolean) and gradle_command (string).inputSchema: { type: "object", properties: { force: { type: "boolean", description: "Force termination during stop", default: false }, gradle_command: { type: "string", description: "Gradle command for restart (default: appRun)" } }
- src/tools/index.js:34-51 (registration)Tool definition in the TOOLS array, registering name, description, and schema.{ name: "restart_tomcat", description: "Stop and start Tomcat", inputSchema: { type: "object", properties: { force: { type: "boolean", description: "Force termination during stop", default: false }, gradle_command: { type: "string", description: "Gradle command for restart (default: appRun)" } } } },
- src/tools/index.js:117-121 (registration)Switch case in handleToolCall that routes restart_tomcat calls to the handler.case "restart_tomcat": return await processManager.restartTomcat( args.force, args.gradle_command );