koala73/worldmonitor · error · SafeWebMcpError

list_followed_countries does not accept arguments.

Error message

list_followed_countries does not accept arguments.

What it means

The WebMCP tool list_followed_countries declares an empty properties schema (additionalProperties: false) and takes no arguments at all. The handler calls hasOnlyOwnKeys(args, []) so any argument — even an empty-but-nonempty-keyed object — throws SafeWebMcpError('validation').

Solutions

  1. Call list_followed_countries with no arguments (empty object or omitted arguments).
  2. Delete any extra keys like limit, cursor, or country from the call.
  3. Verify with the tool schema that properties is empty before invoking.

Example fix

// before
const res = await mcp.callTool('list_followed_countries', { limit: 10 });
// after
const res = await mcp.callTool('list_followed_countries', {});
Defensive patterns

Strategy: validation

Validate before calling

if (args && Object.keys(args).length > 0) throw new Error('list_followed_countries takes no arguments');

Type guard

const isNoArgs = (a: unknown): a is Record<never, never> =>
  a === undefined || (typeof a === 'object' && a !== null && Object.keys(a).length === 0);

Try / catch

try {
  const res = await mcp.callTool('list_followed_countries', {});
} catch (e) {
  if (e instanceof Error && e.message.includes('does not accept arguments')) {
    console.error('This tool is parameterless; drop all arguments', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling list_followed_countries with {}, { limit: 10 }, { country: 'DE' }, or any other key; some clients also send leftover argument objects from a previous tool call.

Common situations: Copy-pasting a call template from another MCP tool; a client that always includes an arguments object with default keys; hand-written JSON-RPC payloads that pass {}-shaped filters out of habit.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src/services/webmcp.ts:3025

          });
        }
        return boundDashboardNavigationResult(await app.openMissionPicker(extra));
      }, trackEvent),
    },
    {
      name: WEBMCP_SPA_TOOL.listFollowedCountries,
      title: 'List Followed Countries',
      description:
        'Read the current followed-country list through the same anonymous or signed-in state used by the dashboard. Returns only ISO 3166-1 alpha-2 codes, access state, and the free-tier limit.',
      inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false,
      },
      annotations: { readOnlyHint: true },
      execute: withBindings(WEBMCP_SPA_TOOL.listFollowedCountries, async (args, extra) => {
        if (!hasOnlyOwnKeys(args, [])) {
          throw new SafeWebMcpError(
            'list_followed_countries does not accept arguments.',
            'validation',
          );
        }
        return boundFollowedCountryList(await app.listFollowedCountries(extra));
      }, trackEvent, {
        successMetadata: (_args, value) => ({
          resultCount: (value as FollowedCountryListResult).countries.length,
        }),
      }),
    },
    {
      name: WEBMCP_SPA_TOOL.setCountryFollowed,
      title: 'Set Country Followed',
      description:
        'Follow or unfollow one country through the dashboard service that owns ISO validation, access state, the free-tier cap, sign-in handoff, and storage. Idempotent for the requested state. Requires target-side cancellation because it persists state or writes to the signed-in account.',
      inputSchema: {
        type: 'object',

View on GitHub (pinned to 7d06c8633d)