{"record":{"id":"35b4728cf7cb6f02","repo":"affaan-m/ECC","slug":"32602","errorCode":"-32602","errorMessage":"The user memory scope is disabled for this MCP server.","messagePattern":"The user memory scope is disabled for this MCP server\\.","errorType":"exception","errorClass":"JsonRpcError","httpStatus":null,"severity":"error","filePath":"scripts/memory-mcp.mjs","lineNumber":182,"sourceCode":"\nfunction resolveServiceSecurity(options = {}) {\n  const env = isRecord(options.env) ? options.env : process.env;\n  const harness = options.harness ?? env.ECC_MEMORY_HARNESS;\n  if (typeof harness !== 'string' || !SLUG_REGEXP.test(harness)) {\n    throw new Error(\n      'ECC_MEMORY_HARNESS must identify this MCP server with a lowercase harness slug.'\n    );\n  }\n  return Object.freeze({\n    harness,\n    allowUserScope: options.allowUserScope ?? env.ECC_MEMORY_ALLOW_USER_SCOPE === '1',\n  });\n}\n\nfunction assertScopesAuthorized(scopes, security) {\n  const requestedScopes = scopes || DEFAULT_RECALL_SCOPES;\n  if (!security.allowUserScope && requestedScopes.includes('user')) {\n    throw new JsonRpcError(\n      -32602,\n      'The user memory scope is disabled for this MCP server.'\n    );\n  }\n  return requestedScopes;\n}\n\nfunction textResult(payload) {\n  const text = JSON.stringify(payload, null, 2);\n  if (Buffer.byteLength(text, 'utf8') > MAX_RESPONSE_BYTES) {\n    throw new JsonRpcError(-32001, 'Memory tool response exceeds the bounded output limit.');\n  }\n  return {\n    content: [{\n      type: 'text',\n      text,\n    }],\n  };","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/memory-mcp.mjs#L164-L200","documentation":"assertScopesAuthorized rejects requests that include the 'user' memory scope when the server was not started with allow-user-scopes (ECC_MEMORY_ALLOW_USER_SCOPE=1). It is a permission boundary, returned as a JSON-RPC invalid-params error.","triggerScenarios":"Triggered when memory-mcp.mjs rejects the current invocation: The user memory scope is disabled for this MCP server.","commonSituations":"Occurs while running scripts/memory-mcp.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/memory-mcp.mjs:182 aborts the command with this message.","solutions":["Re-run without dry-run/disabled mode, or enable the feature required by this operation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}