{"record":{"id":"8d4f897113b2fbf1","repo":"koala73/worldmonitor","slug":"query-must-be-at-most-max-search-query-chars-ch","errorCode":null,"errorMessage":"query must be at most ${MAX_SEARCH_QUERY_CHARS} characters.","messagePattern":"query must be at most (.+?) characters\\.","errorType":"validation","errorClass":"SafeWebMcpError","httpStatus":null,"severity":"error","filePath":"src/services/webmcp.ts","lineNumber":2465,"sourceCode":"            default: DEFAULT_SEARCH_RESULTS,\n          },\n        },\n        required: ['query'],\n        additionalProperties: false,\n      },\n      annotations: { readOnlyHint: true, untrustedContentHint: true },\n      execute: withInvocationLogging(WEBMCP_SPA_TOOL.searchDashboard, async (args, extra) => {\n        if (!hasOnlyOwnKeys(args, ['query', 'scope', 'limit'])) {\n          throw new SafeWebMcpError(\n            'search_dashboard accepts only query, scope, and limit.',\n            'validation',\n          );\n        }\n        if (typeof args.query !== 'string') {\n          throw new SafeWebMcpError('query must be a string.', 'validation');\n        }\n        if (args.query.length > MAX_SEARCH_QUERY_CHARS) {\n          throw new SafeWebMcpError(\n            `query must be at most ${MAX_SEARCH_QUERY_CHARS} characters.`,\n            'validation',\n          );\n        }\n        const query = args.query.trim();\n        if (!query) throw new SafeWebMcpError('query must not be empty.', 'validation');\n\n        const scope = args.scope === undefined ? 'all' : args.scope;\n        if (typeof scope !== 'string' || !DASHBOARD_SEARCH_SCOPES.has(scope as DashboardSearchScope)) {\n          throw new SafeWebMcpError(\n            'scope must be one of: all, signals, map, panels, actions.',\n            'validation',\n          );\n        }\n        const limit = args.limit === undefined ? DEFAULT_SEARCH_RESULTS : args.limit;\n        if (!Number.isInteger(limit) || Number(limit) < 1 || Number(limit) > MAX_SEARCH_RESULTS) {\n          throw new SafeWebMcpError(\n            `limit must be an integer from 1 to ${MAX_SEARCH_RESULTS}.`,","sourceCodeStart":2447,"sourceCodeEnd":2483,"githubUrl":"https://github.com/koala73/worldmonitor/blob/9361220cc013571781071f0206e4d80fd14b2f7f/src/services/webmcp.ts#L2447-L2483","documentation":"A SafeWebMcpError of kind 'validation' thrown by the search_dashboard WebMCP tool when the query argument exceeds MAX_SEARCH_QUERY_CHARS characters. It fires after confirming query is a string but before executing the search, rejecting oversized inputs that would waste tokens or degrade search performance. It is a generic input-length validation guard; the input at fault is an overly long query string. Callers must shorten the query below the maximum length and retry.","triggerScenarios":"Thrown at src/services/webmcp.ts:762 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the query to within the stated character limit","Use more specific search terms instead of pasting large text"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9361220cc013571781071f0206e4d80fd14b2f7f","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}