Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

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
NameRequiredDescriptionDefault
forceNoForce termination with SIGKILL

Implementation Reference

  • 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 } } } },
  • Handler dispatch within handleToolCall that routes stop_tomcat calls to processManager.stopTomcat.
    case "stop_tomcat": return await processManager.stopTomcat(args.force);
  • 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` }); }); }); }

Other Tools

Related Tools

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