xcode_health_check
Analyze and verify the health of the XcodeMCP environment and configurations to ensure optimal performance for build automation and log parsing.
Instructions
Perform a comprehensive health check of the XcodeMCP environment and configuration
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/XcodeServer.ts:349-353 (handler)Handler dispatch for xcode_health_check tool in MCP CallToolRequestSchema - calls EnvironmentValidator.createHealthCheckReport() and returns the result// Handle health check tool first (no environment validation needed) if (name === 'xcode_health_check') { const report = await EnvironmentValidator.createHealthCheckReport(); return { content: [{ type: 'text', text: report }] }; }
- Core implementation: EnvironmentValidator.createHealthCheckReport() generates the comprehensive health check report based on environment validationpublic static async createHealthCheckReport(): Promise<string> { const results = await this.validateEnvironment(); const version = this.getVersion(); const report = [ `XcodeMCP Configuration Health Check (v${version})`, '='.repeat(50), '', this.generateValidationSummary(results), '' ]; if (!results.overall.valid) { report.push('IMMEDIATE ACTIONS REQUIRED:'); results.overall.criticalFailures.forEach(component => { const result = results[component]; if (result && 'valid' in result) { const validationResult = result as EnvironmentValidationResult; report.push(`\n${component.toUpperCase()} FAILURE:`); validationResult.recoveryInstructions?.forEach((instruction: string) => { report.push(`• ${instruction}`); }); } }); if (results.overall.nonCriticalFailures.length > 0) { report.push('\nOPTIONAL IMPROVEMENTS:'); results.overall.nonCriticalFailures.forEach(component => { const result = results[component]; if (result && 'valid' in result) { const validationResult = result as EnvironmentValidationResult; report.push(`\n${component.toUpperCase()}:`); validationResult.recoveryInstructions?.forEach((instruction: string) => { report.push(`• ${instruction}`); }); } }); } } const unavailableFeatures = this.getUnavailableFeatures(results); if (unavailableFeatures.length > 0) { report.push('\nLIMITED FUNCTIONALITY:'); unavailableFeatures.forEach(feature => { report.push(`• ${feature}`); }); } return report.join('\n'); }
- Tool schema definition: no input parameters requiredname: 'xcode_health_check', description: 'Perform a comprehensive health check of the XcodeMCP environment and configuration', inputSchema: { type: 'object', properties: {}, }, },
- src/XcodeServer.ts:301-319 (registration)Tool registration: ListToolsRequestSchema handler calls getToolDefinitions() which includes xcode_health_check and returns it to MCP clientsthis.server.setRequestHandler(ListToolsRequestSchema, async () => { const toolOptions: { includeClean: boolean; preferredScheme?: string; preferredXcodeproj?: string; } = { includeClean: this.includeClean }; if (this.preferredScheme) toolOptions.preferredScheme = this.preferredScheme; if (this.preferredXcodeproj) toolOptions.preferredXcodeproj = this.preferredXcodeproj; const toolDefinitions = getToolDefinitions(toolOptions); return { tools: toolDefinitions.map(tool => ({ name: tool.name, description: tool.description, inputSchema: tool.inputSchema })), }; });
- src/XcodeServer.ts:117-121 (helper)Special handling: xcode_health_check is always allowed even if environment validation fails (called before validation)public async validateToolOperation(toolName: string): Promise<McpResult | null> { // Health check tool should never be blocked if (toolName === 'xcode_health_check') { return null; }