koala73/worldmonitor · error · SafeWebMcpError

limit must be an integer from 1 to ${MAX_SEARCH_RESULTS}.

Error message

limit must be an integer from 1 to ${MAX_SEARCH_RESULTS}.

What it means

SafeWebMcpError thrown by search_dashboard when the optional limit argument is outside the allowed integer range 1..MAX_SEARCH_RESULTS (non-integer, zero, negative, or too large). It bounds result-set size before the search runs.

Source

Thrown at src/services/webmcp.ts:2482

        if (args.query.length > MAX_SEARCH_QUERY_CHARS) {
          throw new SafeWebMcpError(
            `query must be at most ${MAX_SEARCH_QUERY_CHARS} characters.`,
            'validation',
          );
        }
        const query = args.query.trim();
        if (!query) throw new SafeWebMcpError('query must not be empty.', 'validation');

        const scope = args.scope === undefined ? 'all' : args.scope;
        if (typeof scope !== 'string' || !DASHBOARD_SEARCH_SCOPES.has(scope as DashboardSearchScope)) {
          throw new SafeWebMcpError(
            'scope must be one of: all, signals, map, panels, actions.',
            'validation',
          );
        }
        const limit = args.limit === undefined ? DEFAULT_SEARCH_RESULTS : args.limit;
        if (!Number.isInteger(limit) || Number(limit) < 1 || Number(limit) > MAX_SEARCH_RESULTS) {
          throw new SafeWebMcpError(
            `limit must be an integer from 1 to ${MAX_SEARCH_RESULTS}.`,
            'validation',
          );
        }

        return boundDashboardSearchResult(await app.searchDashboard(
          query,
          scope as DashboardSearchScope,
          Number(limit),
          extra,
        ));
      }, trackEvent, {
        successMetadata: (args, value) => {
          const result = value as DashboardSearchResponse;
          return {
            queryLength: typeof args.query === 'string' ? args.query.trim().length : 0,
            resultCount: result.resultCount,
            resultTypes: [...new Set(

View on GitHub (pinned to 9361220cc0)

Solutions

  1. Send limit as an integer within the advertised schema range
  2. Omit limit to accept the default result count
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/services/webmcp.ts:779 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of koala73/worldmonitor@9361220cc0 (2026-08-21). Data as JSON: /api/errors/35b0d9fdb1e4efd2. Report an issue: GitHub.