koala73/worldmonitor · error · SafeWebMcpError

list_mission_presets accepts only available.

Error message

list_mission_presets accepts only available.

What it means

The WebMCP tool list_mission_presets accepts at most a single optional boolean argument, available. The handler enforces this with hasOnlyOwnKeys(args, ['available']) and throws SafeWebMcpError('validation') for any other key set, including extra keys or an empty object with unexpected properties.

Solutions

  1. Call the tool with only { available: true|false } or with no arguments at all.
  2. Remove any additional filter/pagination keys — this tool has none.
  3. Re-fetch tool metadata from the server to confirm the current single-parameter schema.

Example fix

// before
const res = await mcp.callTool('list_mission_presets', { available: true, limit: 5 });
// after
const res = await mcp.callTool('list_mission_presets', { available: true });
Defensive patterns

Strategy: validation

Validate before calling

const keys = Object.keys(args ?? {});
if (keys.some(k => k !== 'available')) throw new Error('list_mission_presets accepts only available.');
if (args?.available !== undefined && typeof args.available !== 'boolean') throw new Error('available must be boolean');

Type guard

const isPresetQuery = (a: unknown): a is { available?: boolean } =>
  a !== null && typeof a === 'object' &&
  Object.keys(a).every(k => k === 'available') &&
  ((a as any).available === undefined || typeof (a as any).available === 'boolean');

Try / catch

try {
  const res = await mcp.callTool('list_mission_presets', { available: true });
} catch (e) {
  if (e instanceof Error && e.message.includes('accepts only available')) {
    console.error('Strip all args except available', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling list_mission_presets with arguments like { category }, { limit }, { available: true, limit: 10 }, or any misspelling such as { availabe: true }.

Common situations: Developers assuming all list_* tools share a pagination schema; passing filters copied from list_dashboard_panels; client-side schema caches that predate the narrowing of the tool's parameters.

Understand the failure class

Background: "Invalid query parameter" / "Failed to parse value of ...": fixing bad query string parameters across APIs — this error's family across 36 libraries.

Related errors


AI-assisted analysis of koala73/worldmonitor@7d06c8633d (2026-09-15). Data as JSON: /api/errors/f1c6e8eb8e44bfe3. Report an issue: GitHub.

Appendix: source

Thrown at src/services/webmcp.ts:2939

    {
      name: WEBMCP_SPA_TOOL.listMissionPresets,
      title: 'List Mission Presets',
      description:
        'List every bundled mission preset for the current monitor. Each item uses a stable preset ID and panel/layer counts without premium payloads. Available rows include intended view and time range. Includes active, monitorCompatible, entitled, and available flags with a stable unavailableReason when gated.',
      inputSchema: {
        type: 'object',
        properties: {
          available: {
            type: 'boolean',
            description: 'If set, keep only presets the current session can apply.',
          },
        },
        additionalProperties: false,
      },
      annotations: { readOnlyHint: true },
      execute: withBindings(WEBMCP_SPA_TOOL.listMissionPresets, async (args, extra) => {
        if (!hasOnlyOwnKeys(args, ['available'])) {
          throw new SafeWebMcpError(
            'list_mission_presets accepts only available.',
            'validation',
          );
        }
        const query: MissionPresetCatalogQuery = {};
        if (args.available !== undefined) query.available = args.available as boolean;
        return boundMissionPresetCatalog(await app.listMissionPresets(query, extra));
      }, trackEvent, {
        successMetadata: (_args, value) => {
          const result = value as MissionPresetCatalogResult;
          return { resultCount: result.presets.length };
        },
      }),
    },
    {
      name: WEBMCP_SPA_TOOL.applyMissionPreset,
      title: 'Apply Mission Preset',
      description:

View on GitHub (pinned to 7d06c8633d)