{"record":{"id":"314766b75db4e759","repo":"eyaltoledano/claude-task-master","slug":"operation-not-found","errorCode":"OPERATION_NOT_FOUND","errorMessage":"Operation ID not found: ${operationId}","messagePattern":"Operation ID not found: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/tools/get-operation-status.js","lineNumber":31,"sourceCode":"\t\tdescription:\n\t\t\t'Retrieves the status and result/error of a background operation.',\n\t\tparameters: z.object({\n\t\t\toperationId: z.string().describe('The ID of the operation to check.')\n\t\t}),\n\t\tannotations: {\n\t\t\ttitle: 'Get Operation Status',\n\t\t\treadOnlyHint: true\n\t\t},\n\t\texecute: async (args, { log }) => {\n\t\t\ttry {\n\t\t\t\tconst { operationId } = args;\n\t\t\t\tlog.info(`Checking status for operation ID: ${operationId}`);\n\n\t\t\t\tconst status = asyncManager.getStatus(operationId);\n\n\t\t\t\t// Status will now always return an object, but it might have status='not_found'\n\t\t\t\tif (status.status === 'not_found') {\n\t\t\t\t\tlog.warn(`Operation ID not found: ${operationId}`);\n\t\t\t\t\treturn createErrorResponse(\n\t\t\t\t\t\tstatus.error?.message || `Operation ID not found: ${operationId}`,\n\t\t\t\t\t\tstatus.error?.code || 'OPERATION_NOT_FOUND'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tlog.info(`Status for ${operationId}: ${status.status}`);\n\t\t\t\treturn createContentResponse(status);\n\t\t\t} catch (error) {\n\t\t\t\tlog.error(`Error in get_operation_status tool: ${error.message}`, {\n\t\t\t\t\tstack: error.stack\n\t\t\t\t});\n\t\t\t\treturn createErrorResponse(\n\t\t\t\t\t`Failed to get operation status: ${error.message}`,\n\t\t\t\t\t'GET_STATUS_ERROR'\n\t\t\t\t);\n\t\t\t}\n\t\t}","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/tools/get-operation-status.js#L13-L49","documentation":"get-operation-status was asked for an operation ID the AsyncOperationManager has no record of, so getStatus returned status='not_found' and the tool converts it into a structured OPERATIONAL error response with code OPERATION_NOT_FOUND. Operation IDs are in-memory and ephemeral, so unknown IDs are expected after restarts.","triggerScenarios":"Calling get-operation-status with an operationId that was never created, a mistyped ID, or an ID from a previous MCP server session (async operations are held in memory and lost on restart or manager reset).","commonSituations":"Client cached an operation ID across an MCP server restart; typo when copying the ID from start-operation output; polling long after the operation completed and the manager pruned it.","solutions":["Re-issue the original operation (start the long-running tool again) and use the freshly returned operation ID.","Verify the operationId string exactly matches the one returned when the operation was started.","If IDs are lost across restarts, restart the workflow rather than polling; there is no persistent operation store."],"exampleFix":"// before\nawait getOperationStatus({ operationId: \"op_17123\" }); // stale after restart\n// after\nconst op = await startLongOperation(...);\nawait getOperationStatus({ operationId: op.operationId });","handlingStrategy":"validation","validationCode":"if (!operationId || typeof operationId !== 'string' || !/^op[_-]?\\w+$/i.test(operationId)) {\n  throw new Error(`Invalid or missing operationId: ${operationId}`);\n}\n// keep operation IDs only for the lifetime of the current server session","typeGuard":"function isOperationId(v) {\n  return typeof v === 'string' && v.length > 0 && v === storedOperationId;\n}","tryCatchPattern":"const res = await getOperationStatus({ operationId });\nif (res.status === 'not_found' || res.code === 'OPERATION_NOT_FOUND') {\n  // re-issue the operation rather than retrying the poll\n  const op = await startOperationAgain();\n}","preventionTips":["Store the operation ID returned by the starting tool immediately and only use that value.","Never reuse operation IDs across MCP server restarts; re-run the operation instead.","Copy-paste the ID rather than retyping it."],"tags":["mcp","async","operation-management","not-found"],"backgroundTag":"operation-id-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}