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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_server_status"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- local-logs-mcp-server.js:338-371 (handler)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 }; } } - local-logs-mcp-server.js:223-225 (registration)Dispatch in handleToolCall switch statement that routes 'get_server_status' tool calls to the getServerStatus() handler.
case 'get_server_status': result = this.getServerStatus(); break; - local-logs-mcp-server.js:140-148 (schema)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: [] } },