Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

restart_tomcat

Stop and start Tomcat to restart Gradle-based applications, with options for forced termination and custom Gradle commands.

Instructions

Stop and start Tomcat

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce termination during stop
gradle_commandNoGradle command for restart (default: appRun)

Implementation Reference

  • Core implementation of restart_tomcat tool: stops Tomcat (optionally forcefully), waits 2 seconds, then starts it with optional Gradle command.
    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
      };
    }
  • Tool dispatcher in handleToolCall: maps tool call to processManager.restartTomcat using input args.
    case "restart_tomcat":
      return await processManager.restartTomcat(
        args.force,
        args.gradle_command
      );
  • Input schema for restart_tomcat tool defining parameters force and gradle_command.
    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)"
        }
      }
    }
  • Registration of restart_tomcat tool in the TOOLS export array, including 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)"
          }
        }
      }
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Stop and start') but lacks details on permissions required, side effects (e.g., downtime, service interruption), error handling, or response format. This is inadequate for a mutation tool with zero annotation coverage.

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 ('Stop and start Tomcat') with zero wasted words. It's front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly.

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 tool's complexity (a mutation operation with potential side effects), no annotations, and no output schema, the description is incomplete. It fails to address critical aspects like behavioral traits, usage context, or output expectations, leaving significant gaps for the agent.

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 schema description coverage is 100%, so the input schema fully documents both parameters ('force' and 'gradle_command'). The description adds no parameter-specific information beyond what's in the schema, resulting in a baseline score of 3 where the schema handles the heavy lifting.

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 clearly states the action ('Stop and start') and target resource ('Tomcat'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'start_tomcat' or 'stop_tomcat', which prevents a score of 5, but it's specific enough to avoid vagueness or tautology.

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 the sibling tools 'start_tomcat' or 'stop_tomcat'. There's no mention of prerequisites, use cases, or exclusions, leaving the agent to infer usage from context 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