{"record":{"id":"92eb64afe3fe8f43","repo":"modelcontextprotocol/servers","slug":"missing-required-arguments","errorCode":null,"errorMessage":"Missing required arguments","messagePattern":"Missing required arguments","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/time/src/mcp_server_time/server.py","lineNumber":201,"sourceCode":"    async def call_tool(\n        name: str, arguments: dict\n    ) -> Sequence[TextContent | ImageContent | EmbeddedResource]:\n        \"\"\"Handle tool calls for time queries.\"\"\"\n        try:\n            match name:\n                case TimeTools.GET_CURRENT_TIME.value:\n                    timezone = arguments.get(\"timezone\")\n                    if not timezone:\n                        raise ValueError(\"Missing required argument: timezone\")\n\n                    result = time_server.get_current_time(timezone)\n\n                case TimeTools.CONVERT_TIME.value:\n                    if not all(\n                        k in arguments\n                        for k in [\"source_timezone\", \"time\", \"target_timezone\"]\n                    ):\n                        raise ValueError(\"Missing required arguments\")\n\n                    result = time_server.convert_time(\n                        arguments[\"source_timezone\"],\n                        arguments[\"time\"],\n                        arguments[\"target_timezone\"],\n                    )\n                case _:\n                    raise ValueError(f\"Unknown tool: {name}\")\n\n            return [\n                TextContent(type=\"text\", text=json.dumps(result.model_dump(), indent=2))\n            ]\n\n        except Exception as e:\n            raise ValueError(f\"Error processing mcp-server-time query: {str(e)}\")\n\n    options = server.create_initialization_options()\n    async with stdio_server() as (read_stream, write_stream):","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/modelcontextprotocol/servers/blob/76d64c822f5125032f89eb71dbdb94e42b434821/src/time/src/mcp_server_time/server.py#L183-L219","documentation":"The convert_time branch (server.py:196-201) requires all three keys source_timezone, time, target_timezone to be present; if any is missing it raises ValueError('Missing required arguments'). As with 46, the outer handler (error 49) re-wraps this, so the specific message is hidden from the client.","triggerScenarios":"Calling convert_time missing one of the three required keys (most often target_timezone), or with a typo'd key name like 'source_tz' instead of 'source_timezone'.","commonSituations":"Client forgets a field; key-name drift from docs; LLM drops a required parameter; partial form submission.","solutions":["Include all three keys: source_timezone, time, target_timezone.","Check key presence and spelling client-side against the schema before the call.","Fix the outer except (error 49) to surface this message if you maintain the server."],"exampleFix":"// before\n//   {\"source_timezone\":\"UTC\",\"time\":\"12:00\"}                 -> Missing required arguments\n// after\n//   {\"source_timezone\":\"UTC\",\"time\":\"12:00\",\"target_timezone\":\"America/New_York\"}","handlingStrategy":"validation","validationCode":"required = (\"source_timezone\", \"time\", \"target_timezone\")\nmissing = [k for k in required if k not in arguments]\nif missing:\n    raise ValueError(f\"missing required keys: {missing}\")","typeGuard":"def has_convert_args(args: object) -> bool:\n    required = (\"source_timezone\", \"time\", \"target_timezone\")\n    return isinstance(args, dict) and all(k in args and args[k] for k in required)","tryCatchPattern":null,"preventionTips":["Check all three keys and their spelling against the schema before calling.","Reject partial submissions at the UI boundary.","Remember the real message is masked by error 49; validate proactively."],"tags":["time","arguments","validation","python"],"backgroundTag":null,"analyzedSha":"76d64c822f5125032f89eb71dbdb94e42b434821","analyzedAt":"2026-08-12T10:02:41.718Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}