Skip to main content
Glama

xcresult_summary

Analyze and summarize test results from an XCResult file to quickly assess test outcomes and streamline Xcode build automation workflows with XcodeMCP.

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

  • The core handler function xcresultSummary that executes the tool logic: validates the XCResult file path, parses the file using XCResultParser, generates a formatted summary with pass/fail stats, 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 tool registration/dispatch: switch case in CallToolRequestSchema handler that validates input 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);
  • Input schema definition for xcresult_summary tool: requires xcresult_path string parameter.
    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'], }, },
  • Duplicate registration in direct callToolDirect method (CLI compatibility) that calls the handler.
    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);
  • Fallback schema definition in MCP library (used when CLI list-tools fails).
    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'], },

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