list_crash_dumps
Scan directories recursively to discover crash dump files for system analysis.
Instructions
Scans for crash dumps in the specified directory (recursive).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search_path | No | /app/crash |
Implementation Reference
- src/crash_mcp/server.py:33-62 (handler)The handler function for the 'list_crash_dumps' MCP tool. It is decorated with @mcp.tool() for registration with FastMCP. Scans the specified directory recursively for crash dumps using CrashDiscovery.find_dumps, sorts them by modification time, limits to top 10, and formats the output as a string.@mcp.tool() def list_crash_dumps(search_path: str = Config.CRASH_SEARCH_PATH) -> str: """Scans for crash dumps in the specified directory (recursive).""" logger.info(f"Listing crash dumps in {search_path}") try: dumps = CrashDiscovery.find_dumps([search_path]) if not dumps: return "No crash dumps found." # Sort by modification time (newest first) dumps.sort(key=lambda x: x['modified'], reverse=True) # Limit to top 10 to save tokens total_count = len(dumps) limit = 10 dumps = dumps[:limit] output = [f"Found {total_count} crash dumps (showing top {limit}):"] for d in dumps: output.append(f"- {d['path']} (Size: {d['size']} bytes)") if total_count > limit: output.append(f"... and {total_count - limit} more.") logger.info(f"Returning {len(output)} lines of output") return "\n".join(output) except Exception as e: logger.error(f"Error in list_crash_dumps: {e}", exc_info=True) return f"Error scanning for dumps: {str(e)}"
- src/crash_mcp/server.py:33-33 (registration)The @mcp.tool() decorator registers the list_crash_dumps function as an MCP tool with FastMCP instance 'mcp'.@mcp.tool()