{"record":{"id":"72b4b1aa689b8172","repo":"affaan-m/ECC","slug":"32001","errorCode":"-32001","errorMessage":"Memory tool response exceeds the bounded output limit.","messagePattern":"Memory tool response exceeds the bounded output limit\\.","errorType":"exception","errorClass":"JsonRpcError","httpStatus":null,"severity":"error","filePath":"scripts/memory-mcp.mjs","lineNumber":193,"sourceCode":"    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  };\n}\n\nfunction toolFailure(code, error) {\n  const suspectedSecret = error instanceof Error\n    && error.message.toLowerCase().includes('suspected secret');\n  const message = suspectedSecret\n    ? 'Memory operation rejected a suspected secret.'\n    : {\n      MEMORY_WRITE_REJECTED: 'Memory write was rejected by validation.',\n      MEMORY_SEARCH_FAILED: 'Memory search failed validation.',\n      MEMORY_READ_FAILED: 'Memory was not found or is not visible to this harness.',","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/memory-mcp.mjs#L175-L211","documentation":"textResult enforces a bounded output size: the JSON-serialized tool payload exceeds MAX_RESPONSE_BYTES, so the MCP response is refused (as a -32001 JSON-RPC error) rather than flooding the harness with an oversized message.","triggerScenarios":"Triggered when memory-mcp.mjs rejects the current invocation: Memory tool response exceeds the bounded output limit.","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:193 aborts the command with this message.","solutions":["Adjust the input so it falls within the allowed size/range/non-empty constraint in the message."],"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-14T00:17:10.932Z"}