Skip to main content
Glama
mariosss

Local Logs MCP Server

by mariosss

get_server_status

Check server health and status by analyzing local application logs to monitor performance and identify issues.

Instructions

Get server status summary from logs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The getServerStatus() method implements the core logic of the 'get_server_status' tool by tailing recent logs from combined.log and error.log, analyzing them for status indicators, and returning a status summary.
    getServerStatus() {
      try {
        const combinedResult = this.tailLog('combined.log', 10);
        const errorResult = this.tailLog('error.log', 5);
        
        const recentLogs = combinedResult.content ? 
          combinedResult.content.split('\n').filter(line => line.trim()).slice(-5) : [];
        
        const recentErrors = errorResult.content ? 
          errorResult.content.split('\n').filter(line => line.trim()) : [];
    
        // Analyze logs for server status
        let status = 'unknown';
        if (recentLogs.some(log => log.includes('Worker') && log.includes('ready'))) {
          status = 'running';
        } else if (recentLogs.some(log => log.includes('error') || log.includes('Error'))) {
          status = 'error';
        } else if (recentLogs.length > 0) {
          status = 'active';
        }
    
        return {
          status,
          recentLogs,
          recentErrors,
          errorCount: recentErrors.length,
          logsAvailable: combinedResult.content ? true : false,
          lastActivity: recentLogs.length > 0 ? 'recently active' : 'no recent activity',
          message: combinedResult.message || 'No logs available'
        };
      } catch (error) {
        return { status: 'error', error: error.message };
      }
    }
  • Dispatch in handleToolCall switch statement that routes 'get_server_status' tool calls to the getServerStatus() handler.
    case 'get_server_status':
      result = this.getServerStatus();
      break;
  • Tool registration in tools/list response including name, description, and empty input schema.
    {
      name: 'get_server_status',
      description: 'Get server status summary from logs',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      }
    },
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 ('Get') but doesn't reveal any behavioral traits such as read-only vs. destructive nature, authentication requirements, rate limits, or what the 'summary' entails. This leaves significant gaps for a tool that interacts with logs.

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 that directly states the tool's purpose without any unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured.

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 interacting with server logs and the lack of annotations and output schema, the description is insufficient. It doesn't explain what 'status summary' includes, how it's derived from logs, or the return format, leaving the agent with incomplete context for effective use.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't add parameter details, and the baseline for this scenario is 4, as it avoids redundancy while being complete for a parameterless tool.

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 verb ('Get') and resource ('server status summary from logs'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_errors' or 'search_logs', which might also retrieve log-related information, preventing 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 'get_errors' or 'search_logs'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent with minimal direction for tool selection.

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/mariosss/local-logs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server