Skip to main content
Glama

xcresult_summary

Extract and summarize test results from Xcode .xcresult files to quickly identify test outcomes and failures.

Instructions

Get a quick summary of test results from an XCResult file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xcresult_pathYesAbsolute path to the .xcresult file

Implementation Reference

  • Core implementation of xcresult_summary tool. Validates input path, uses XCResultParser to analyze the XCResult file, generates formatted summary with test counts, pass rate, duration, top failures, and usage instructions.
    public static async xcresultSummary(xcresultPath: string): Promise<McpResult> {
      // Validate xcresult path
      if (!existsSync(xcresultPath)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `XCResult file not found: ${xcresultPath}`
        );
      }
    
      if (!xcresultPath.endsWith('.xcresult')) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Path must be an .xcresult file: ${xcresultPath}`
        );
      }
    
      // Check if xcresult is readable
      if (!XCResultParser.isXCResultReadable(xcresultPath)) {
        throw new McpError(
          ErrorCode.InternalError,
          `XCResult file is not readable or incomplete: ${xcresultPath}`
        );
      }
    
      try {
        const parser = new XCResultParser(xcresultPath);
        const analysis = await parser.analyzeXCResult();
    
        let output = `📊 XCResult Summary - ${xcresultPath}\n`;
        output += '='.repeat(80) + '\n\n';
        output += `Result: ${analysis.summary.result === 'Failed' ? '❌' : '✅'} ${analysis.summary.result}\n`;
        output += `Total: ${analysis.totalTests} | Passed: ${analysis.passedTests} ✅ | Failed: ${analysis.failedTests} ❌ | Skipped: ${analysis.skippedTests} ⏭️\n`;
        output += `Pass Rate: ${analysis.passRate.toFixed(1)}%\n`;
        output += `Duration: ${analysis.duration}\n\n`;
    
        if (analysis.failedTests > 0) {
          output += `❌ Failed Tests:\n`;
          for (const failure of analysis.summary.testFailures.slice(0, 5)) {
            output += `  • ${failure.testName}: ${failure.failureText.substring(0, 100)}${failure.failureText.length > 100 ? '...' : ''}\n`;
          }
          if (analysis.summary.testFailures.length > 5) {
            output += `  ... and ${analysis.summary.testFailures.length - 5} more\n`;
          }
          output += '\n';
        }
    
        output += `💡 Use 'xcresult_browse "${xcresultPath}"' to explore detailed results.`;
    
        return { content: [{ type: 'text', text: output }] };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        
        if (errorMessage.includes('xcresulttool')) {
          throw new McpError(
            ErrorCode.InternalError,
            `XCResult parsing failed. Make sure Xcode Command Line Tools are installed: ${errorMessage}`
          );
        }
        
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to analyze XCResult: ${errorMessage}`
        );
      }
    }
  • MCP server handler that validates parameters and delegates to XCResultTools.xcresultSummary
    case 'xcresult_summary':
      if (!args.xcresult_path) {
        throw new McpError(ErrorCode.InvalidParams, `Missing required parameter: xcresult_path`);
      }
      return await XCResultTools.xcresultSummary(args.xcresult_path as string);
  • Tool schema definition used by MCP server listTools handler and CLI
    {
      name: 'xcresult_summary',
      description: 'Get a quick summary of test results from an XCResult file',
      inputSchema: {
        type: 'object',
        properties: {
          xcresult_path: {
            type: 'string',
            description: 'Absolute path to the .xcresult file',
          },
        },
        required: ['xcresult_path'],
      },
    },
  • Fallback tool schema definition for MCP library
      name: 'xcresult_summary',
      description: 'Get a quick summary of test results from an XCResult file',
      inputSchema: {
        type: 'object',
        properties: {
          xcresult_path: {
            type: 'string',
            description: 'Absolute path to the .xcresult file',
          },
        },
        required: ['xcresult_path'],
      },
    },
  • MCP server registration of all tools including xcresult_summary via getToolDefinitions from shared/toolDefinitions.ts (includes the tool schema). Also has duplicate direct handler call logic at lines 978-1010.
    this.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
        })),
      };
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 mentions 'quick summary' but doesn't specify what that includes (e.g., pass/fail counts, duration, error details), whether it's read-only or has side effects, or any performance or permission considerations. This leaves significant gaps for a tool that processes test results.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and easy to parse, making it highly concise and well-structured for quick understanding.

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 lack of annotations and output schema, the description is incomplete for a tool that handles test results. It doesn't explain what the summary contains, how it's formatted, or any error handling, which are critical for an agent to use it effectively in a testing context with multiple sibling tools.

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

Parameters3/5

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

The input schema has 100% description coverage, with the single parameter 'xcresult_path' clearly documented as an absolute path. The description doesn't add any additional semantic context beyond what the schema provides, such as file format expectations or validation rules, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('summary of test results from an XCResult file'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'xcresult_browse' or 'xcresult_list_attachments', which might offer similar or overlapping functionality.

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. With multiple sibling tools related to XCResult files (e.g., 'xcresult_browse', 'xcresult_list_attachments'), there's no indication of when this 'quick summary' is preferred over other options, leaving the agent to guess based on context.

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