health_check
Verify the operational status of the GASSAPI MCP server to ensure it's running correctly and ready for API management tasks.
Instructions
Check if the MCP server is running properly
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:43-78 (handler)The asynchronous handler function that executes the health_check tool logic. It computes server uptime, memory usage, lists available tools, and returns a formatted status response or error.[healthCheckTool.name]: async (args: Record<string, any>) => { try { const uptime = process.uptime(); const memory = process.memoryUsage(); const status = { server: 'GASSAPI MCP Client', version: '1.0.0', status: 'healthy', timestamp: new Date().toISOString(), uptime: uptime, memory: memory, tools: ALL_TOOLS.map(t => t.name), migration_status: 'Refactoring Complete - Modular Structure Implemented' }; return { content: [ { type: 'text', text: `✅ GASSAPI MCP Server Status\n\n${JSON.stringify(status, null, 2)}` } ] }; } catch (error) { return { content: [ { type: 'text', text: `❌ Health check failed: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/index.ts:15-22 (schema)The tool definition including name, description, and input schema (empty object). Used in ALL_TOOLS export.export const healthCheckTool: McpTool = { name: 'health_check', description: 'Check if the MCP server is running properly', inputSchema: { type: 'object', properties: {} } };
- src/server.ts:90-97 (registration)Registers the health_check handler via createAllToolHandlers() into toolHandlers map and registers the tool object from ALL_TOOLS into the server's tools Map and availableTools array.this.toolHandlers = createAllToolHandlers(); // Initialize tools immediately for consistency ALL_TOOLS.forEach(tool => { this.tools.set(tool.name, tool); }); this.availableTools = ALL_TOOLS; this.toolsLoaded = true;
- src/server.ts:134-152 (registration)Fallback registration in case of tool loading error: defines a minimal healthCheckTool and registers it exclusively to ensure server functionality.const healthCheckTool = { name: 'health_check', description: 'Check if the MCP server is running properly', inputSchema: { type: 'object', properties: {} } }; this.tools.clear(); this.tools.set(healthCheckTool.name, healthCheckTool); this.availableTools = [healthCheckTool]; this.toolsLoaded = true; logger.warn('Using fallback tool registration', { toolsCount: this.tools.size, tools: Array.from(this.tools.keys()), module: 'McpServer' });
- src/server.ts:334-372 (schema)Legacy or alternative handler method in McpServer class (not actively used in toolHandlers routing). Provides similar health check logic.private async handleHealthCheck(args: Record<string, any>): Promise<any> { try { const uptime = (Date.now() - this.startTime) / 1000; const memory = process.memoryUsage(); // Ensure tools are loaded await this.ensureToolsLoaded(); const status = { server: 'GASSAPI MCP Client', version: '1.0.0', status: 'healthy', timestamp: new Date().toISOString(), uptime: uptime, memory: memory, tools: Array.from(this.tools.keys()), migration_status: 'Step 1 - Core Framework Migrated' }; return { content: [ { type: 'text', text: `✅ GASSAPI MCP Server Status\n\n${JSON.stringify(status, null, 2)}` } ] }; } catch (error) { return { content: [ { type: 'text', text: `❌ Health check failed: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }