Skip to main content
Glama

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: [] } },

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