health_check
Verify the operational status and accessibility of the Kubecost API to ensure the cost management platform is functioning correctly.
Instructions
Check if Kubecost API is healthy and accessible
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:223-246 (handler)Primary MCP tool handler and registration for 'health_check'. Calls kubecostClient.healthCheck() and formats the response as text.this.tool( 'health_check', 'Check if Kubecost API is healthy and accessible', {}, async () => { try { const isHealthy = await this.kubecostClient.healthCheck(); return { isError: false, content: [{ type: 'text', text: isHealthy ? 'Kubecost API is healthy and accessible' : 'Kubecost API is not accessible' }] }; } catch (error) { return { isError: true, content: [{ type: 'text', text: error instanceof Error ? error.message : String(error) }] }; } } );
- src/client/kubecost-client.ts:84-91 (helper)Core helper function that performs the actual health check by querying the Kubecost /healthz endpoint.async healthCheck(): Promise<boolean> { try { await this.client.get('/healthz'); return true; } catch (error) { return false; } }
- src/tools/cost-tools.ts:57-64 (schema)Tool schema definition for health_check (no inputs required), though not used in main registration.health_check: { description: 'Check if Kubecost API is healthy and accessible', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/tools/cost-tools.ts:123-135 (handler)Alternative handler implementation in cost-tools module (switch case in handleCostToolCall).case 'health_check': { const isHealthy = await kubecostClient.healthCheck(); return { content: [ { type: 'text', text: isHealthy ? 'Kubecost API is healthy and accessible' : 'Kubecost API is not accessible', }, ], }; }
- src/index.ts:226-226 (schema)Inline empty schema for health_check tool in main registration (no input parameters).{},