{"record":{"id":"0a616860cb5af92b","repo":"koala73/worldmonitor","slug":"query-must-be-a-string","errorCode":null,"errorMessage":"query must be a string.","messagePattern":"query must be a string\\.","errorType":"validation","errorClass":"SafeWebMcpError","httpStatus":null,"severity":"error","filePath":"src/services/webmcp.ts","lineNumber":2541,"sourceCode":"          timeRange: {\n            type: 'string',\n            description: 'Dashboard time-range control value.',\n            enum: [...DASHBOARD_TIME_RANGES],\n          },\n        },\n        required: ['timeRange'],\n        additionalProperties: false,\n      },\n      annotations: { readOnlyHint: false },\n      execute: withBindings(WEBMCP_SPA_TOOL.setTimeRange, async (args, extra) => (\n        applyDashboardAction({\n          type: 'set_time_range',\n          timeRange: args.timeRange,\n        }, app, extra)\n      ), trackEvent),\n    },\n    {\n      name: WEBMCP_SPA_TOOL.focusCountry,\n      title: 'Focus Country On Map',\n      description:\n        'Focus the visible map on a country bounding box by ISO 3166-1 alpha-2 code without opening a country brief or consuming briefing quota.',\n      inputSchema: {\n        type: 'object',\n        properties: {\n          iso2: {\n            type: 'string',\n            description: 'ISO 3166-1 alpha-2 country code, uppercase.',\n            pattern: DASHBOARD_COUNTRY_CODE_PATTERN,\n          },\n        },\n        required: ['iso2'],\n        additionalProperties: false,\n      },\n      annotations: { readOnlyHint: false },\n      execute: withBindings(WEBMCP_SPA_TOOL.focusCountry, async (args, extra) => {\n        const iso2 = typeof args.iso2 === 'string' ? args.iso2.toUpperCase() : '';","sourceCodeStart":2523,"sourceCodeEnd":2559,"githubUrl":"https://github.com/koala73/worldmonitor/blob/e586b8b4b80f595aa7ece295eec10d76f2921240/src/services/webmcp.ts#L2523-L2559","documentation":"SafeWebMcpError thrown by the search_dashboard tool's execute guard when the query argument is not a string (missing, number, object, etc.). It is a manual input-shape check that backstops the JSON schema, classed as a validation error for the MCP client.","triggerScenarios":"Thrown at src/services/webmcp.ts:759 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send query as a JSON string in the tool arguments","Fix the calling MCP client's argument serialization"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e586b8b4b80f595aa7ece295eec10d76f2921240","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}