Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

clear_logs

Clear log buffer and files in Gradle Tomcat MCP Server to free up storage and maintain system performance. Requires confirmation for execution.

Instructions

Clear log buffer and files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmYesConfirmation required to clear logs

Implementation Reference

  • The clearLogs method in LogManager that executes the tool logic: clears the in-memory log buffer and deletes all log files in 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}` }; } }
  • Input schema definition for the clear_logs tool, requiring a 'confirm' boolean parameter.
    inputSchema: { type: "object", properties: { confirm: { type: "boolean", description: "Confirmation required to clear logs", default: false } }, required: ["confirm"] }
  • Tool call dispatcher registration for 'clear_logs': validates confirmation argument 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();

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