{"record":{"id":"a688207a0a64f2a7","repo":"alibaba/arthas","slug":"action-operation-requires-index-parameter","errorCode":null,"errorMessage":"${action} operation requires index parameter","messagePattern":"(.+?) 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":121,"sourceCode":"\n    /**\n     * 验证参数\n     */\n    private void validateParameters(String action, String classPattern, String methodPattern, \n                                   Integer index, String searchExpression) {\n        switch (action) {\n            case \"record\":\n                if (classPattern == null || classPattern.trim().isEmpty()) {\n                    throw new IllegalArgumentException(\"classPattern is required for record operation\");\n                }\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        }","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/mcp/tool/function/monitor200/TimeTunnelTool.java#L103-L139","documentation":"Both the info and replay actions require an index parameter referencing a specific TimeTunnel recording entry (the index shown by tt list). Without it Arthas cannot know which recorded invocation to inspect or replay.","triggerScenarios":"Calling tt with action=info or action=replay while index is null. The same message is used for both actions, with the action name interpolated.","commonSituations":"User forgets to run tt list first to discover available indices; MCP client omits the index field.","solutions":["Run tt(action=\"list\") first to see recorded entries and their indices.","Pass the integer index shown in the list output.","Ensure the index still exists (it may have been deleted)."],"exampleFix":"// before\ntt(action=\"info\")\n// after\n// first: tt(action=\"list\") to find index 1000\ntt(action=\"info\", index=1000)","handlingStrategy":"validation","validationCode":"// Before calling tt info/replay, validate index\nif ((\"info\".equals(normalizedAction) || \"replay\".equals(normalizedAction))\n        && index == null) {\n    throw new IllegalArgumentException(\"index is required for tt \" + normalizedAction);\n}","typeGuard":null,"tryCatchPattern":"try {\n    String result = timeTunnel(action, ..., index, ...);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"index parameter\")) {\n        // index missing for info or replay — run tt list first to find it\n    }\n}","preventionTips":["Run tt(action=\"list\") before info or replay to discover valid indices.","Always pass the index when using info or replay.","Handle stale indices (the recording may have been deleted)."],"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"}