Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

stop_tomcat

Terminate the Tomcat process in Gradle-based applications to stop the server. Use the force option for immediate termination with SIGKILL.

Instructions

Terminate Tomcat process

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce termination with SIGKILL

Implementation Reference

  • Registers the 'stop_tomcat' tool in the TOOLS array, including its name, description, and input schema defining an optional 'force' boolean parameter.
    {
      name: "stop_tomcat",
      description: "Terminate Tomcat process",
      inputSchema: {
        type: "object",
        properties: {
          force: {
            type: "boolean",
            description: "Force termination with SIGKILL",
            default: false
          }
        }
      }
    },
  • Handler dispatch in handleToolCall function that invokes ProcessManager.stopTomcat with the force argument for the stop_tomcat tool.
    case "stop_tomcat":
      return await processManager.stopTomcat(args.force);
  • Core implementation of the stop_tomcat tool logic in ProcessManager class: stops the Tomcat process with SIGTERM (graceful) or SIGKILL (force), with a 10-second timeout fallback to force kill.
    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` });
        });
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Terminate' implies a destructive action, but it doesn't specify permissions required, whether termination is graceful or immediate by default, or what happens post-termination (e.g., error handling). The description adds minimal value beyond the obvious implication of stopping a process.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place in conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a destructive operation with no annotations and no output schema, the description is incomplete. It doesn't address critical context like what 'terminate' entails (e.g., SIGTERM vs. SIGKILL), error scenarios, or return values, leaving significant gaps for an agent to handle this tool safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'force' parameter clearly documented in the schema. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for adequate but unenhanced parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Terminate Tomcat process' clearly states the action (terminate) and target resource (Tomcat process), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'restart_tomcat' or 'get_tomcat_status' beyond the basic verb difference, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'restart_tomcat' or 'get_tomcat_status'. It lacks context about prerequisites (e.g., Tomcat must be running), consequences (e.g., service interruption), or typical use cases, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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