# Arthas 4.x MCP Tools Reference (29 Tools)

| Category | Tool | Description | Key Arguments |
| :--- | :--- | :--- | :--- |
| **JVM Monitor** | `dashboard` | Real-time JVM overview (CPU, memory, threads, GC, runtime) | `-n 1`, `-i 5000` |
| **JVM Monitor** | `thread` | Thread stack analysis, busy thread lookup, deadlock detection | `-n 3`, `-b`, `-i 1000` |
| **JVM Monitor** | `jvm` | Detailed JVM runtime & system environment variables | (none) |
| **JVM Monitor** | `memory` | JVM memory spaces utilization breakdown | (none) |
| **JVM Monitor** | `perfcounter` | Internal JVM performance counter values | (none) |
| **JVM Monitor** | `sysprop` | View and modify JVM system properties | `sysprop key [val]` |
| **JVM Monitor** | `sysenv` | View OS environment variables | (none) |
| **JVM Monitor** | `vmoption` | View and update VM flags (e.g. PrintGC) | `vmoption [name] [val]` |
| **JVM Monitor** | `mbean` | Real-time JMX MBean monitoring & attribute inspection | `mbean java.lang:*` |
| **Class & Loader** | `sc` | Search classes loaded by JVM | `-d`, `-f`, `class-pattern` |
| **Class & Loader** | `sm` | Search methods on loaded classes | `-d`, `class-pattern [method-pattern]` |
| **Class & Loader** | `jad` | Decompile specified class bytecode into source code | `--source-only` |
| **Class & Loader** | `classloader` | Inspect classloader hierarchy, URLs, and stats | `-t`, `-l` |
| **Dynamic Trace** | `watch` | Observe method arguments, return values, exceptions | `class method '{params,returnObj}' -x 2 -n 5` |
| **Dynamic Trace** | `trace` | Trace method execution tree & elapsed time breakdown | `class method -n 5 '#cost > 50'` |
| **Dynamic Trace** | `stack` | Display call stack leading to method invocation | `class method -n 3` |
| **Dynamic Trace** | `monitor` | Monitor method execution stats (success rate, latency) | `class method -c 5` |
| **Dynamic Trace** | `tt` | Time Tunnel: record and replay method invocations | `-t class method -n 5`, `-l`, `-i index` |
| **Diagnostics** | `heapdump` | Generate HPROF heap dump file | `[--live] [output-file]` |
| **Diagnostics** | `vmtool` | JVMTI tools: force GC, get object instances, interrupt | `--action forceGc`, `--action getInstances` |
| **Diagnostics** | `profiler` | Sampling profiler and flamegraph generator | `start`, `stop --format html` |
| **Diagnostics** | `getstatic` | Inspect static field values of a class | `class field` |
| **Diagnostics** | `ognl` | Evaluate dynamic OGNL expressions | `'@java.lang.System@getProperty("os.name")'` |
| **Hot Reload** | `mc` | Memory compiler (compile .java to .class in memory) | `/path/to/Source.java` |
| **Hot Reload** | `redefine` | Redefine loaded classes with new .class files | `/path/to/Class.class` |
| **Hot Reload** | `retransform` | Retransform classes using bytecode instrumentation | `/path/to/Class.class` |
| **Management** | `options` | Inspect and configure global Arthas runtime options | `[option-name] [val]` |
| **Management** | `dump` | Dump loaded bytecode to disk | `-d /path/to/dir class-pattern` |
| **Management** | `stop` | Shut down Arthas server and reset all instrumentations | (none) |
