bruno_health_check
Monitor the operational status of the Bruno MCP server and CLI, with options to view performance metrics and cache statistics for system verification.
Instructions
Check the health status of the Bruno MCP server and Bruno CLI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeMetrics | No | Include performance metrics in output | |
| includeCacheStats | No | Include cache statistics in output |
Implementation Reference
- The HealthCheckHandler class implements the IToolHandler interface for the 'bruno_health_check' tool. It validates inputs, checks Bruno CLI availability, gathers performance metrics and cache stats if requested, formats the output using HealthCheckFormatter, and returns a text response with health diagnostics.export class HealthCheckHandler implements IToolHandler { private readonly brunoCLI: IBrunoCLI; private readonly configLoader: IConfigLoader; private readonly perfManager: IPerformanceManager; private readonly formatter: HealthCheckFormatter; constructor( brunoCLI: IBrunoCLI, configLoader: IConfigLoader, perfManager: IPerformanceManager ) { this.brunoCLI = brunoCLI; this.configLoader = configLoader; this.perfManager = perfManager; this.formatter = new HealthCheckFormatter(); } getName(): string { return 'bruno_health_check'; } async handle(args: unknown): Promise<ToolResponse> { const params = HealthCheckSchema.parse(args); const config = this.configLoader.getConfig(); // Check Bruno CLI availability const brunoCLIAvailable = await this.brunoCLI.isAvailable(); const brunoCLIVersion = brunoCLIAvailable ? await this.getBrunoCLIVersion() : 'Not available'; // Gather metrics and cache stats if requested const metricsSummary = params.includeMetrics ? this.perfManager.getMetricsSummary() : undefined; const cacheStats = params.includeCacheStats ? this.perfManager.getCacheStats() : undefined; const output = this.formatter.format({ brunoCLIAvailable, brunoCLIVersion, config, includeMetrics: params.includeMetrics || false, includeCacheStats: params.includeCacheStats || false, metricsSummary, cacheStats }); return { content: [ { type: 'text', text: output } as TextContent ] }; } private async getBrunoCLIVersion(): Promise<string> { try { // Use execa directly to get version - BrunoCLI.isAvailable already logs version // This is a simpler approach since we just checked availability return 'Available (use --version for details)'; } catch { return 'Unknown'; } } }
- Zod schema used for input validation in the bruno_health_check handler.const HealthCheckSchema = z.object({ includeMetrics: z.boolean().optional().describe('Include performance metrics in output'), includeCacheStats: z.boolean().optional().describe('Include cache statistics in output') });
- src/index.ts:138-154 (registration)MCP Tool object registration in the TOOLS array, defining the name, description, and input schema for 'bruno_health_check'.{ name: 'bruno_health_check', description: 'Check the health status of the Bruno MCP server and Bruno CLI', inputSchema: { type: 'object', properties: { includeMetrics: { type: 'boolean', description: 'Include performance metrics in output' }, includeCacheStats: { type: 'boolean', description: 'Include cache statistics in output' } } } },
- src/index.ts:292-292 (registration)Registration of the HealthCheckHandler instance into the ToolRegistry for execution dispatch.this.toolRegistry.register(new HealthCheckHandler(this.brunoCLI, this.configLoader, perfManager));