run_crash_command
Execute crash utility commands to analyze Linux system crash dumps, including sys, bt, log, ps, files, vm, and kmem operations.
Instructions
Runs crash utility command (e.g., sys, bt, log, ps, files, vm, kmem).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| session_id | No | ||
| truncate | No |
Implementation Reference
- src/crash_mcp/server.py:92-112 (handler)The MCP tool handler for 'run_crash_command', registered via @mcp.tool() decorator. Retrieves the session, validates it, and delegates command execution to UnifiedSession.execute_command with 'crash:' prefix.@mcp.tool() def run_crash_command(command: str, session_id: Optional[str] = None, truncate: bool = True) -> str: """Runs crash utility command (e.g., sys, bt, log, ps, files, vm, kmem).""" target_id = session_id or last_session_id if not target_id: return "Error: No session specified and no active default session." if target_id not in sessions: return f"Error: Session ID {target_id} not found." session = sessions[target_id] if not session.is_active(): del sessions[target_id] return "Error: Session is no longer active." try: return session.execute_command(f"crash:{command}", truncate=truncate) except Exception as e: return f"Error executing command: {str(e)}"
- src/crash_mcp/server.py:92-92 (registration)The @mcp.tool() decorator registers the run_crash_command function as an MCP tool.@mcp.tool()