Skip to main content
Glama

xcode_health_check

Verify XcodeMCP environment and configuration health to ensure proper build automation and log parsing functionality.

Instructions

Perform a comprehensive health check of the XcodeMCP environment and configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler implementation: Performs comprehensive environment validation (OS, Xcode, XCLogParser, osascript, permissions) and generates a detailed human-readable health report with recovery instructions.
    public 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');
    }
  • MCP tool request handler registration: Dispatches 'xcode_health_check' calls to EnvironmentValidator.createHealthCheckReport() in the main CallToolRequestSchema handler.
    try {
      // 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 }] };
      }
  • CLI direct tool call registration: Identical dispatch logic for CLI's callToolDirect method.
    if (name === 'xcode_health_check') {
      const report = await EnvironmentValidator.createHealthCheckReport();
      return { content: [{ type: 'text', text: report }] };
  • Tool schema definition: Defines name, description, and empty input schema (no parameters required). Used by both CLI and MCP.
      name: 'xcode_health_check',
      description: 'Perform a comprehensive health check of the XcodeMCP environment and configuration',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Core helper: Performs all individual environment validations (OS, Xcode installation, tools, permissions) that feed into the health check report.
    public static async validateEnvironment(): Promise<EnvironmentValidation> {
      const results: EnvironmentValidation = {
        os: await this.validateOS(),
        xcode: await this.validateXcode(),
        xclogparser: await this.validateXCLogParser(),
        osascript: await this.validateOSAScript(),
        permissions: await this.validatePermissions(),
        overall: { valid: false, canOperateInDegradedMode: false, criticalFailures: [], nonCriticalFailures: [] }
      };
    
      // Determine overall validity and degraded mode capability
      const criticalFailures = ['os', 'osascript'].filter(key => !results[key]?.valid);
      const nonCriticalFailures = ['xcode', 'xclogparser', 'permissions'].filter(key => !results[key]?.valid);
    
      results.overall = {
        valid: criticalFailures.length === 0 && nonCriticalFailures.length === 0,
        canOperateInDegradedMode: criticalFailures.length === 0,
        criticalFailures,
        nonCriticalFailures
      };
    
      this.validationResults = results;
      return results;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool performs a 'comprehensive health check', implying it might inspect system status or configuration issues, but it does not specify what aspects are checked (e.g., installation, permissions, project integrity), whether it requires specific permissions, or what the output entails (e.g., logs, status codes). This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that clearly states the tool's purpose without any redundant information. It is front-loaded and appropriately sized for a tool with no parameters, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a health check tool with no annotations and no output schema, the description is incomplete. It does not explain what the health check entails, what issues it might detect, or what the return values are (e.g., success/failure, diagnostic details). For a tool that likely provides status information, this lack of detail makes it insufficient for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and the schema description coverage is 100%, so there is no need for parameter details in the description. The baseline for 0 parameters is 4, as the description appropriately does not include unnecessary parameter information, though it could hint at any implicit inputs (e.g., environment context), which it does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool performs a 'comprehensive health check of the XcodeMCP environment and configuration', which is a clear purpose with a specific verb ('perform health check') and resource ('XcodeMCP environment and configuration'). However, it does not differentiate from sibling tools like 'xcode_get_workspace_info' or 'xcode_get_projects' that might also provide diagnostic information, making it somewhat vague in comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as whether Xcode needs to be running or if it's for troubleshooting, nor does it suggest when to use other tools like 'xcode_get_workspace_info' for specific checks. This lack of context leaves usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lapfelix/XcodeMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server