{"record":{"id":"0a2252b41c8860a2","repo":"alibaba/arthas","slug":"delete-operation-requires-index-parameter","errorCode":null,"errorMessage":"delete operation requires index parameter","messagePattern":"delete operation requires index parameter","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/TimeTunnelTool.java","lineNumber":131,"sourceCode":"                }\n                if (methodPattern == null || methodPattern.trim().isEmpty()) {\n                    throw new IllegalArgumentException(\"methodPattern is required for record operation\");\n                }\n                break;\n            case \"info\":\n            case \"replay\":\n                if (index == null) {\n                    throw new IllegalArgumentException(action + \" operation requires index parameter\");\n                }\n                break;\n            case \"search\":\n                if (searchExpression == null || searchExpression.trim().isEmpty()) {\n                    throw new IllegalArgumentException(\"search operation requires searchExpression parameter\");\n                }\n                break;\n            case \"delete\":\n                if (index == null) {\n                    throw new IllegalArgumentException(\"delete operation requires index parameter\");\n                }\n                break;\n            case \"list\":\n            case \"deleteall\":\n                break;\n            default:\n                throw new IllegalArgumentException(\"Unsupported action: \" + action);\n        }\n    }\n\n    /**\n     * 标准化操作类型\n     */\n    private String normalizeAction(String action) {\n        if (action == null || action.trim().isEmpty()) {\n            return \"record\";\n        }\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/TimeTunnelTool.java#L113-L149","documentation":"The delete action requires an index to identify which specific recording entry to remove. Use deleteAll to remove all entries without an index.","triggerScenarios":"Calling tt with action=delete while index is null.","commonSituations":"User forgets to specify which recording to delete; confuses delete with deleteAll.","solutions":["Run tt(action=\"list\") to find the index of the recording to delete.","Pass the integer index.","Use action=deleteAll (alias da) if you want to clear all recordings."],"exampleFix":"// before\ntt(action=\"delete\")\n// after\ntt(action=\"delete\", index=1000)\n// or delete everything:\ntt(action=\"deleteAll\")","handlingStrategy":"validation","validationCode":"// Before calling tt delete, validate index\nif (\"delete\".equals(normalizedAction) && index == null) {\n    throw new IllegalArgumentException(\"index is required for tt delete\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    String result = timeTunnel(action, ..., index, ...);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"delete operation requires index\")) {\n        // index missing — provide it or use deleteAll\n    }\n}","preventionTips":["Run tt(action=\"list\") to find the index before deleting.","Use action=deleteAll (alias da) to remove all recordings without an index.","Always pass index for single-entry delete."],"tags":["tt","required-param","validation","timetunnel","arthas-mcp"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}