{"record":{"id":"e55f999fe69925d1","repo":"alibaba/arthas","slug":"unsupported-action-input-supported-actions","errorCode":null,"errorMessage":"Unsupported action: ${input}. Supported actions: ${supportedList}","messagePattern":"Unsupported action: (.+?)\\. Supported actions: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/ProfilerTool.java","lineNumber":240,"sourceCode":"        if (action == null || action.trim().isEmpty()) {\n            throw new IllegalArgumentException(\"action is required\");\n        }\n\n        String input = action.trim();\n        for (String supported : SUPPORTED_ACTIONS) {\n            if (supported.equalsIgnoreCase(input)) {\n                return supported;\n            }\n        }\n\n        StringBuilder supportedList = new StringBuilder();\n        for (int i = 0; i < SUPPORTED_ACTIONS.length; i++) {\n            if (i > 0) {\n                supportedList.append(\", \");\n            }\n            supportedList.append(SUPPORTED_ACTIONS[i]);\n        }\n        throw new IllegalArgumentException(\"Unsupported action: \" + input + \". Supported actions: \" + supportedList);\n    }\n\n    private void addOption(StringBuilder cmd, String option, String value) {\n        if (value == null || value.trim().isEmpty()) {\n            return;\n        }\n        cmd.append(\" \").append(option);\n        addParameter(cmd, value);\n    }\n\n    private void addOption(StringBuilder cmd, String option, Long value) {\n        if (value == null) {\n            return;\n        }\n        cmd.append(\" \").append(option).append(\" \").append(value);\n    }\n\n    private void addOption(StringBuilder cmd, String option, Integer value) {","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/ProfilerTool.java#L222-L258","documentation":"After trimming and case-insensitive matching against the 15 supported actions (SUPPORTED_ACTIONS array), normalizeAction rejects any unrecognized value and lists all valid options in the message. Matching is case-insensitive, so 'START' and 'start' both pass.","triggerScenarios":"Passing an action string not in {start, resume, stop, dump, status, meminfo, list, version, load, execute, dumpCollapsed, dumpFlat, dumpTraces, getSamples, actions}. Case-insensitive matching still applies, so only genuinely unknown names trigger this.","commonSituations":"Typo in the action name; using an Arthas CLI profiler subcommand name that differs from the MCP tool's mapping; version mismatch where a newer action is not yet supported in this build.","solutions":["Use one of the listed supported actions exactly (case-insensitive).","Call profiler(action=\"actions\") to see the full list at runtime.","Check spelling: common mistakes include 'stopAll', 'pause', 'reset' which are not supported."],"exampleFix":"// before\nprofiler(action=\"pause\")\n// after\nprofiler(action=\"stop\")","handlingStrategy":"validation","validationCode":"// Before calling profiler, validate action against the supported list\nSet<String> supported = Set.of(\"start\",\"resume\",\"stop\",\"dump\",\"status\",\"meminfo\",\n    \"list\",\"version\",\"load\",\"execute\",\"dumpCollapsed\",\"dumpFlat\",\"dumpTraces\",\"getSamples\",\"actions\");\nif (action == null || supported.stream().noneMatch(s -> s.equalsIgnoreCase(action.trim()))) {\n    throw new IllegalArgumentException(\"Unsupported profiler action: \" + action);\n}","typeGuard":null,"tryCatchPattern":"try {\n    String result = profiler(action, ...);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported action\")) {\n        // action not in the supported list — check the message for valid options\n    }\n}","preventionTips":["Use action=actions to list all valid profiler actions at runtime.","Maintain a client-side allowlist of supported actions.","Be aware that CLI profiler subcommand names may differ from MCP action names."],"tags":["profiler","invalid-param","enum","async-profiler","arthas-mcp"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}