koala73/worldmonitor · error · SafeWebMcpError

query must not be empty.

Error message

query must not be empty.

What it means

A SafeWebMcpError of kind 'validation' thrown by the search_dashboard WebMCP tool when the query argument is an empty string (zero length). It fires after the string-type and max-length checks, rejecting queries that carry no search terms and would return meaningless default results. It is a generic empty-input validation guard; the input at fault is a query of ''. Callers must supply a non-empty search string.

Source

Thrown at src/services/webmcp.ts:2471

      annotations: { readOnlyHint: true, untrustedContentHint: true },
      execute: withInvocationLogging(WEBMCP_SPA_TOOL.searchDashboard, async (args, extra) => {
        if (!hasOnlyOwnKeys(args, ['query', 'scope', 'limit'])) {
          throw new SafeWebMcpError(
            'search_dashboard accepts only query, scope, and limit.',
            'validation',
          );
        }
        if (typeof args.query !== 'string') {
          throw new SafeWebMcpError('query must be a string.', 'validation');
        }
        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,

View on GitHub (pinned to 9361220cc0)

Solutions

  1. Provide at least one non-whitespace search term
  2. Validate non-empty input in the calling client before invoking the tool
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/services/webmcp.ts:768 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/a9477f3fce1678db. Report an issue: GitHub.