stop_tomcat
Terminate the Tomcat process in the Gradle Tomcat MCP Server. Use the optional force flag for immediate termination via SIGKILL.
Instructions
Terminate Tomcat process
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Force termination with SIGKILL |
Implementation Reference
- src/tools/index.js:20-33 (registration)Registration of the stop_tomcat tool in the exported TOOLS array, including name, description, and input schema.{ name: "stop_tomcat", description: "Terminate Tomcat process", inputSchema: { type: "object", properties: { force: { type: "boolean", description: "Force termination with SIGKILL", default: false } } } },
- src/tools/index.js:114-115 (handler)Handler dispatch within handleToolCall that routes stop_tomcat calls to processManager.stopTomcat.case "stop_tomcat": return await processManager.stopTomcat(args.force);
- src/process-manager.js:69-95 (handler)Primary implementation of the stop_tomcat tool logic: terminates the Tomcat process gracefully or forcefully.async stopTomcat(force = false) { if (!this.process) { return { success: true, message: 'Tomcat is not running' }; } return new Promise((resolve) => { const pid = this.process.pid; if (force) { this.process.kill('SIGKILL'); } else { this.process.kill('SIGTERM'); } const timeout = setTimeout(() => { if (this.process) { this.process.kill('SIGKILL'); } resolve({ success: true, message: `Tomcat process ${pid} forcefully terminated` }); }, 10000); this.process.on('exit', () => { clearTimeout(timeout); resolve({ success: true, message: `Tomcat process ${pid} terminated gracefully` }); }); }); }