{"record":{"id":"03219bf3f87024ab","repo":"browser-use/browser-use","slug":"action-func-name-has-param-name-which","errorCode":null,"errorMessage":"Action '{func.__name__}' has **{param.name} which is not allowed. Actions must have explicit positional parameters only.","messagePattern":"Action '(.+?)' has \\*\\*(.+?) which is not allowed\\. Actions must have explicit positional parameters only\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"browser_use/tools/registry/service.py","lineNumber":97,"sourceCode":"\t\tparam_model: type[BaseModel] | None = None,\n\t) -> tuple[Callable, type[BaseModel]]:\n\t\t\"\"\"\n\t\tNormalize action function to accept only kwargs.\n\n\t\tReturns:\n\t\t\t- Normalized function that accepts (*_, params: ParamModel, **special_params)\n\t\t\t- The param model to use for registration\n\t\t\"\"\"\n\t\tsig = signature(func)\n\t\tparameters = list(sig.parameters.values())\n\t\tspecial_param_types = self._get_special_param_types()\n\t\tspecial_param_names = set(special_param_types.keys())\n\n\t\t# Step 1: Validate no **kwargs in original function signature\n\t\t# if it needs default values it must use a dedicated param_model: BaseModel instead\n\t\tfor param in parameters:\n\t\t\tif param.kind == Parameter.VAR_KEYWORD:\n\t\t\t\traise ValueError(\n\t\t\t\t\tf\"Action '{func.__name__}' has **{param.name} which is not allowed. \"\n\t\t\t\t\tf'Actions must have explicit positional parameters only.'\n\t\t\t\t)\n\n\t\t# Step 2: Separate special and action parameters\n\t\taction_params = []\n\t\tspecial_params = []\n\t\tparam_model_provided = param_model is not None\n\n\t\tfor i, param in enumerate(parameters):\n\t\t\t# Check if this is a Type 1 pattern (first param is BaseModel)\n\t\t\tif i == 0 and param_model_provided and param.name not in special_param_names:\n\t\t\t\t# This is Type 1 pattern - skip the params argument\n\t\t\t\tcontinue\n\n\t\t\tif param.name in special_param_names:\n\t\t\t\t# Validate special parameter type\n\t\t\t\texpected_type = special_param_types.get(param.name)","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/tools/registry/service.py#L79-L115","documentation":"Error \"Action '{func.__name__}' has **{param.name} which is not allowed. Actions must have explicit positional parameters only.\" thrown in browser-use/browser-use.","triggerScenarios":"A registered action function declares **kwargs (VAR_KEYWORD parameter).","commonSituations":"Writing @tools.action functions with **kwargs instead of explicit named parameters.","solutions":["Remove **kwargs (variadic keyword params) from the action signature; declare explicit parameters."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}