{"record":{"id":"ad70e11d5d2f08ac","repo":"JuliusBrussee/caveman","slug":"unknown-experiment-read-action-action","errorCode":null,"errorMessage":"unknown experiment read action: ${action}","messagePattern":"unknown experiment read action: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/agent-mcp.ts","lineNumber":590,"sourceCode":"        value = await client.request(`/api/v1/traces/search?${new URLSearchParams({ project_id: projectId })}`, {\n          method: \"POST\",\n          body: args,\n        });\n        break;\n      }\n      case \"caveman_trace_get\": {\n        const traceId = encodeURIComponent(stringArg(args, \"trace_id\"));\n        const projectQuery = `?${new URLSearchParams({ project_id: await client.projectId() })}`;\n        const [trace, spans] = await Promise.all([\n          client.request(`/api/v1/traces/${traceId}${projectQuery}`),\n          client.request(`/api/v1/traces/${traceId}/spans${projectQuery}`),\n        ]);\n        value = { trace: metadataOnlyTrace(trace), spans: metadataOnlySpans(spans) };\n        break;\n      }\n      case \"caveman_experiment_get\": {\n        const action = stringArg(args, \"action\");\n        if (![\"list\", \"get\", \"results\"].includes(action)) throw new Error(`unknown experiment read action: ${action}`);\n        if (action === \"list\") {\n          value = await client.request(await withProjectQuery(client, \"/api/v1/experiments\"));\n          break;\n        }\n        const experimentId = encodeURIComponent(stringArg(args, \"experiment_id\"));\n        const query = new URLSearchParams({ project_id: await client.projectId() });\n        value = await client.request(`/api/v1/experiments/${experimentId}${action === \"results\" ? \"/results\" : \"\"}?${query}`);\n        break;\n      }\n      default:\n        throw new Error(`unknown tool: ${name}`);\n    }\n    return result(value);\n  } catch (error) {\n    outcome = \"error\";\n    return errorResult(error);\n  } finally {\n    client.recordToolCall?.({ tool: name, result: outcome, durationMs: Date.now() - started });","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/agent-mcp.ts#L572-L608","documentation":"Dispatch error in the MCP callTool handler for experiment reads: the action string supplied by the client is not one of the implemented experiment read actions. The switch over known actions fell through, so the requested view cannot be produced.","triggerScenarios":"Calling caveman_experiment_get with {action:\"delete\"}, {action:\"create\"}, {action:\"fetch\"}, or an empty action string.","commonSituations":"Agents conflating read and write tool variants; typos like 'lists' or 'result'; older prompts referencing actions that were removed from the read tool.","solutions":["Use action: \"list\", \"get\", or \"results\" exactly","For mutations, find the separate experiment write tool instead of caveman_experiment_get","Fix typos in the action string","Note that \"get\" and \"results\" also require experiment_id"],"exampleFix":"// before\nawait callTool(client, \"caveman_experiment_get\", { action: \"fetch\", experiment_id: \"e1\" });\n// after\nawait callTool(client, \"caveman_experiment_get\", { action: \"get\", experiment_id: \"e1\" });","handlingStrategy":"validation","validationCode":"const READ_ACTIONS = [\"list\",\"get\",\"results\"];\nif (!READ_ACTIONS.includes(args.action)) throw new Error(\"action must be one of \" + READ_ACTIONS.join(\"|\"));","typeGuard":"function isExperimentReadAction(a: string): a is \"list\"|\"get\"|\"results\" { return [\"list\",\"get\",\"results\"].includes(a); }","tryCatchPattern":"try { ... } catch (e) { if (e.message.startsWith(\"unknown experiment read action\")) { return callTool(client, \"caveman_experiment_get\", { action: \"list\" }); } throw e; }","preventionTips":["Constrain the action parameter to the union \"list\"|\"get\"|\"results\" in your client types","Route write operations to the dedicated write tool","Fallback to \"list\" when unsure which experiment to target"],"tags":["validation","cli","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}