Skip to main content
Glama

analyze_crash

Analyze Android and iOS crash logs to identify patterns and root causes. Supports live device analysis and iOS symbolication for debugging mobile applications.

Instructions

Analyze crash logs and device logs to identify crash patterns and root causes. Supports both Android (logcat) and iOS (crash files + oslog). For live device analysis, checks device logs automatically. For iOS, can also analyze .ips/.crash files with symbolication.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesTarget platform to analyze
appIdNoApp ID (Android package name or iOS bundle ID) for live device log analysis
deviceIdNoDevice ID for analysis (optional, uses first available device)
crashLogPathNoPath to iOS crash log file (.ips or .crash) - iOS only, optional for live analysis
dsymPathNoPath to dSYM file or directory - iOS only (optional, searches common locations)
timeRangeSecondsNoTime range in seconds to search device logs (default: 300 = 5 minutes)
skipSymbolicationNoSkip symbolication for faster analysis - iOS only (default: false)
includeRawLogNoInclude raw log data in output (default: false)

Implementation Reference

  • Core handler function that orchestrates the crash analysis logic for both Android and iOS platforms, including validation, platform dispatch, and sub-analysis calls.
    export async function analyzeCrash(args: AnalyzeCrashArgs): Promise<ExtendedCrashAnalysis> { const { platform, crashLogPath, appId, deviceId, dsymPath, timeRangeSeconds = 300, skipSymbolication = false, includeRawLog = false, } = args; const startTime = Date.now(); // Validate platform if (!isPlatform(platform)) { throw Errors.invalidArguments(`Invalid platform: ${platform}. Must be 'android' or 'ios'`); } const targetPlatform = platform as Platform; // Determine analysis mode if (targetPlatform === 'android') { // Android: Always use live device log analysis return analyzeAndroidCrash({ appId, deviceId, timeRangeSeconds, includeRawLog, startTime, }); } else { // iOS: Use crash log file if provided, otherwise live analysis if (crashLogPath) { return analyzeIOSCrashFile({ crashLogPath, dsymPath, bundleId: appId, skipSymbolication, includeRawLog, startTime, }); } else { return analyzeIOSDeviceLogs({ appId, deviceId, timeRangeSeconds, includeRawLog, startTime, }); } } }
  • TypeScript interface defining the input schema/arguments for the analyze_crash tool.
    export interface AnalyzeCrashArgs { /** Target platform (required) */ platform: string; /** Path to the crash log file (.ips or .crash) - iOS only, optional for live analysis */ crashLogPath?: string; /** App ID (Android package name or iOS bundle ID) for live device log analysis */ appId?: string; /** Device ID for live device log analysis (optional, uses first available) */ deviceId?: string; /** Path to dSYM file or directory (optional, iOS only) */ dsymPath?: string; /** Time range in seconds to search logs (default: 300 = 5 minutes) */ timeRangeSeconds?: number; /** Skip symbolication (faster, less detailed) - iOS only */ skipSymbolication?: boolean; /** Include raw crash log in output */ includeRawLog?: boolean; }
  • Registration function for the 'analyze_crash' tool, including detailed input schema (JSON) and the tool execution handler lambda.
    export function registerAnalyzeCrashTool(): void { getToolRegistry().register( 'analyze_crash', { description: 'Analyze crash logs and device logs to identify crash patterns and root causes. ' + 'Supports both Android (logcat) and iOS (crash files + oslog). ' + 'For live device analysis, checks device logs automatically. ' + 'For iOS, can also analyze .ips/.crash files with symbolication.', inputSchema: createInputSchema( { platform: { type: 'string', enum: ['android', 'ios'], description: 'Target platform to analyze', }, appId: { type: 'string', description: 'App ID (Android package name or iOS bundle ID) for live device log analysis', }, deviceId: { type: 'string', description: 'Device ID for analysis (optional, uses first available device)', }, crashLogPath: { type: 'string', description: 'Path to iOS crash log file (.ips or .crash) - iOS only, optional for live analysis', }, dsymPath: { type: 'string', description: 'Path to dSYM file or directory - iOS only (optional, searches common locations)', }, timeRangeSeconds: { type: 'number', description: 'Time range in seconds to search device logs (default: 300 = 5 minutes)', }, skipSymbolication: { type: 'boolean', description: 'Skip symbolication for faster analysis - iOS only (default: false)', }, includeRawLog: { type: 'boolean', description: 'Include raw log data in output (default: false)', }, }, ['platform'] ), }, async (args) => { const result = await analyzeCrash(args as unknown as AnalyzeCrashArgs); return { ...result, formattedOutput: formatAnalysisForAI(result), }; } ); }
  • Import and invocation of the analyze_crash tool registration during overall tool registration in server startup.
    const { registerAnalyzeCrashTool } = await import('./crash/analyze-crash.js'); registerAnalyzeCrashTool();

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/abd3lraouf/specter-mcp'

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