Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

clear_logs

Remove log buffer and files from Gradle Tomcat applications to free disk space and maintain system performance.

Instructions

Clear log buffer and files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmYesConfirmation required to clear logs

Implementation Reference

  • The clearLogs method of LogManager class that clears the in-memory log buffer and deletes all .log files from the configured log directory.
    clearLogs() {
      this.logBuffer = [];
      
      try {
        const files = fs.readdirSync(this.logDir);
        for (const file of files) {
          if (file.endsWith('.log')) {
            fs.unlinkSync(path.join(this.logDir, file));
          }
        }
        return { success: true, message: 'Logs cleared successfully' };
      } catch (error) {
        return { success: false, message: `Failed to clear log files: ${error.message}` };
      }
    }
  • JSON schema definition for the clear_logs tool, defining input parameters with a required 'confirm' boolean.
    {
      name: "clear_logs",
      description: "Clear log buffer and files",
      inputSchema: {
        type: "object",
        properties: {
          confirm: {
            type: "boolean",
            description: "Confirmation required to clear logs",
            default: false
          }
        },
        required: ["confirm"]
      }
    }
  • Registration and dispatching logic in the handleToolCall switch statement that checks the 'confirm' parameter and invokes the logManager.clearLogs() handler.
    case "clear_logs":
      if (!args.confirm) {
        throw new Error("Confirmation required to clear logs. Set confirm=true");
      }
      return logManager.clearLogs();
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. 'Clear' implies destructive action, but it doesn't specify whether logs are permanently deleted, recoverable, or archived. No information about permissions, side effects, or system impact is included.

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 extremely concise (4 words) and front-loaded with the core action. Every word earns its place with zero wasted text or redundancy.

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?

For a destructive tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'clear' entails operationally, what data is lost, whether there are confirmation prompts beyond the parameter, or what happens after execution.

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?

Schema description coverage is 100%, so the schema already documents the 'confirm' parameter thoroughly. The description adds no additional parameter context beyond what's in the schema, maintaining the baseline score for high schema coverage.

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 ('clear') and target resources ('log buffer and files'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_logs' or explain how this differs from other maintenance operations.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or warnings about when NOT to use it (e.g., during debugging).

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