{"record":{"id":"b32e5b3f12823e82","repo":"koala73/worldmonitor","slug":"dashboard-search-result-exceeded-the-safe-output-l","errorCode":null,"errorMessage":"Dashboard search result exceeded the safe output limit.","messagePattern":"Dashboard search result exceeded the safe output limit\\.","errorType":"exception","errorClass":"SafeWebMcpError","httpStatus":null,"severity":"error","filePath":"src/services/webmcp.ts","lineNumber":1164,"sourceCode":"\nfunction boundDashboardActionResult(result: DashboardActionResult): Record<string, unknown> & {\n  ok: boolean;\n  status: DashboardActionStatus;\n} {\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 requested = boundDashboardViewState(result.requested);\n  const effective = boundDashboardViewState(result.effective);\n  const compatibility = boundDashboardCompatibility(result.compatibility);\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    ...(requested ? { requested } : {}),\n    ...(effective ? { effective } : {}),\n    ...(compatibility ? { compatibility } : {}),\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))","sourceCodeStart":1146,"sourceCodeEnd":1182,"githubUrl":"https://github.com/koala73/worldmonitor/blob/e586b8b4b80f595aa7ece295eec10d76f2921240/src/services/webmcp.ts#L1146-L1182","documentation":"SafeWebMcpError thrown by the dashboard search tool when, after iteratively popping results down to the output target, the bounded response still exceeds MAX_OUTPUT_CHARS. The graceful shrink loop failed to bring an (extremely large or pathological) result set under the hard cap, so the search refuses to return it.","triggerScenarios":"Thrown at src/services/webmcp.ts:493 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with a smaller limit parameter or a narrower scope","Make the search result renderer trim per-entry text so shrink iterations converge faster","Investigate entries with abnormally long content that defeat truncation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e586b8b4b80f595aa7ece295eec10d76f2921240","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}