{"record":{"id":"5845fda85c843146","repo":"microsoft/autogen","slug":"strict-mode-is-enabled-but-not-all-input-argument","errorCode":null,"errorMessage":"Strict mode is enabled, but not all input arguments are marked as required. Default arguments are not allowed in strict mode.","messagePattern":"Strict mode is enabled, but not all input arguments are marked as required\\. Default arguments are not allowed in strict mode\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-core/src/autogen_core/tools/_base.py","lineNumber":132,"sourceCode":"    @property\n    def schema(self) -> ToolSchema:\n        model_schema: Dict[str, Any] = self._args_type.model_json_schema()\n\n        if \"$defs\" in model_schema:\n            model_schema = cast(Dict[str, Any], jsonref.replace_refs(obj=model_schema, proxies=False))  # type: ignore\n            del model_schema[\"$defs\"]\n\n        parameters = ParametersSchema(\n            type=\"object\",\n            properties=model_schema[\"properties\"],\n            required=model_schema.get(\"required\", []),\n            additionalProperties=model_schema.get(\"additionalProperties\", False),\n        )\n\n        # If strict is enabled, the tool schema should list all properties as required.\n        assert \"required\" in parameters\n        if self._strict and set(parameters[\"required\"]) != set(parameters[\"properties\"].keys()):\n            raise ValueError(\n                \"Strict mode is enabled, but not all input arguments are marked as required. Default arguments are not allowed in strict mode.\"\n            )\n\n        assert \"additionalProperties\" in parameters\n        if self._strict and parameters[\"additionalProperties\"]:\n            raise ValueError(\n                \"Strict mode is enabled but additional argument is also enabled. This is not allowed in strict mode.\"\n            )\n\n        tool_schema = ToolSchema(\n            name=self._name,\n            description=self._description,\n            parameters=parameters,\n            strict=self._strict,\n        )\n        return tool_schema\n\n    @property","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-core/src/autogen_core/tools/_base.py#L114-L150","documentation":"Error \"Strict mode is enabled, but not all input arguments are marked as required. Default arguments are not allowed in strict mode.\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-core/src/autogen_core/tools/_base.py:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove default values from parameters or disable strict mode"],"exampleFix":"Make all parameters required (no defaults) when strict=True","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}