{"record":{"id":"e2c340369c198075","repo":"koala73/worldmonitor","slug":"dashboard-action-result-exceeded-the-safe-output-l","errorCode":null,"errorMessage":"Dashboard action result exceeded the safe output limit.","messagePattern":"Dashboard action result exceeded the safe output limit\\.","errorType":"exception","errorClass":"SafeWebMcpError","httpStatus":null,"severity":"error","filePath":"src/services/webmcp.ts","lineNumber":620,"sourceCode":"} {\n  const targets = (Array.isArray(result.targets) ? result.targets : []).map((target) => ({\n    target: boundedText(target?.target, 96),\n    status: target?.status,\n    ...(target?.reason ? { reason: boundedText(target.reason, 64) } : {}),\n  }));\n  const bounded = {\n    ok: result.ok === true,\n    status: result.status,\n    ...(result.actionType ? { actionType: result.actionType } : {}),\n    ...(result.reason ? { reason: boundedText(result.reason, 64) } : {}),\n    message: boundedText(result.message, 240),\n    targets,\n    targetCount: targets.length,\n    targetsTruncated: false,\n  };\n\n  if (JSON.stringify(bounded).length > MAX_OUTPUT_CHARS) {\n    throw new SafeWebMcpError('Dashboard action result exceeded the safe output limit.');\n  }\n  return bounded;\n}\n\nfunction boundDashboardSearchResult(result: DashboardSearchResponse): DashboardSearchResponse {\n  const sourceResults = Array.isArray(result.results) ? result.results : [];\n  const results = sourceResults\n    .filter((match) => typeof match?.key === 'string' && SEARCH_RESULT_KEY.test(match.key))\n    .slice(0, MAX_SEARCH_RESULTS)\n    .map((match) => ({\n      key: match.key,\n      type: boundedText(match?.type, DASHBOARD_SEARCH_TYPE_MAX_CHARS),\n      title: boundedText(match?.title, DASHBOARD_SEARCH_TITLE_MAX_CHARS),\n      ...(match?.subtitle ? {\n        subtitle: boundedText(match.subtitle, DASHBOARD_SEARCH_SUBTITLE_MAX_CHARS),\n      } : {}),\n      executable: match?.executable === true,\n    }));","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/koala73/worldmonitor/blob/a96956387a927b8cd7aa34b0c41fca357e746be9/src/services/webmcp.ts#L602-L638","documentation":"The WebMCP dashboard-action result sanitizer detected that the serialized action result exceeds the safe output limit even after bounding each text field (message 240 chars, target fields 96/64 chars). This is a size guard on the MCP tool response: the action produced an unexpectedly large payload (typically too many targets) and the bounded envelope would still be too big to return.","triggerScenarios":"Thrown at src/services/webmcp.ts:456 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the action's output size at the source (fewer targets, shorter messages) before serialization","Trim the targets array and set targetsTruncated to fit the limit instead of failing","Add a unit test asserting the bounded envelope stays under the limit for worst-case inputs"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a96956387a927b8cd7aa34b0c41fca357e746be9","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}