Skip to main content
Glama
lkb2k

Gradle Tomcat MCP Server

by lkb2k

get_logs

Retrieve recent log entries from Gradle Tomcat applications to monitor application behavior, filter by log level, source, or time period for debugging and troubleshooting.

Instructions

Retrieve log entries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesNoNumber of recent log lines to retrieve (default: 100)
levelNoMinimum log level (DEBUG, INFO, WARN, ERROR)
sinceNoISO 8601 timestamp to filter logs from
sourceNoFilter by log source (stdout, stderr)

Implementation Reference

  • Executes the get_logs tool logic: filters the in-memory log buffer by lines, level, since timestamp, and source, returning the most recent matching entries.
    getLogs(options = {}) {
      const {
        lines = 100,
        level = null,
        since = null,
        source = null
      } = options;
    
      let filteredLogs = [...this.logBuffer];
    
      if (level) {
        const levelPriority = { 'DEBUG': 0, 'INFO': 1, 'WARN': 2, 'ERROR': 3 };
        const minPriority = levelPriority[level.toUpperCase()] || 0;
        filteredLogs = filteredLogs.filter(log => 
          (levelPriority[log.level] || 0) >= minPriority
        );
      }
    
      if (since) {
        const sinceDate = new Date(since);
        filteredLogs = filteredLogs.filter(log => 
          new Date(log.timestamp) >= sinceDate
        );
      }
    
      if (source) {
        filteredLogs = filteredLogs.filter(log => 
          log.source === source
        );
      }
    
      return filteredLogs.slice(-lines);
    }
  • Defines the input schema for the get_logs tool, specifying parameters for log retrieval.
    inputSchema: {
      type: "object",
      properties: {
        lines: {
          type: "number",
          description: "Number of recent log lines to retrieve (default: 100)",
          default: 100
        },
        level: {
          type: "string",
          description: "Minimum log level (DEBUG, INFO, WARN, ERROR)",
          enum: ["DEBUG", "INFO", "WARN", "ERROR"]
        },
        since: {
          type: "string",
          description: "ISO 8601 timestamp to filter logs from"
        },
        source: {
          type: "string",
          description: "Filter by log source (stdout, stderr)",
          enum: ["stdout", "stderr"]
        }
      }
    }
  • Registers the get_logs tool handler by mapping the tool name to logManager.getLogs call in the tool dispatcher.
    case "get_logs":
      return logManager.getLogs({
        lines: args.lines,
        level: args.level,
        since: args.since,
        source: args.source
      });
  • Tool registration in the TOOLS array export, including name, description, and input schema for MCP protocol.
    {
      name: "get_logs",
      description: "Retrieve log entries",
      inputSchema: {
        type: "object",
        properties: {
          lines: {
            type: "number",
            description: "Number of recent log lines to retrieve (default: 100)",
            default: 100
          },
          level: {
            type: "string",
            description: "Minimum log level (DEBUG, INFO, WARN, ERROR)",
            enum: ["DEBUG", "INFO", "WARN", "ERROR"]
          },
          since: {
            type: "string",
            description: "ISO 8601 timestamp to filter logs from"
          },
          source: {
            type: "string",
            description: "Filter by log source (stdout, stderr)",
            enum: ["stdout", "stderr"]
          }
        }
      }
    },
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. 'Retrieve log entries' implies a read-only operation but doesn't specify whether this requires authentication, has rate limits, returns paginated results, or what format/logic governs the retrieval. For a log tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 phrase that gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core purpose immediately.

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 has 4 parameters, no annotations, and no output schema, the description is inadequate. 'Retrieve log entries' doesn't explain what gets returned (format, structure, limitations), doesn't address authentication or access requirements, and provides no context about the log system being accessed. For a tool with this complexity and zero structured metadata, the description should do more.

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 all parameters are well-documented in the schema itself. The description adds no additional parameter information beyond what's already in the structured schema. This meets the baseline expectation when schema does the heavy lifting, but doesn't provide extra semantic context.

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 'Retrieve log entries' clearly states the verb (retrieve) and resource (log entries), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'clear_logs' or 'get_tomcat_status', which would require more specific scope information to earn 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. With siblings like 'clear_logs' (destructive) and 'get_tomcat_status' (status monitoring), there's no indication of when this retrieval tool is appropriate versus those other options, nor any prerequisites or constraints mentioned.

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