{"record":{"id":"d78d091186ba26c8","repo":"microsoft/semantic-kernel","slug":"no-argument-is-provided-for-the-parameter-name","errorCode":null,"errorMessage":"No argument is provided for the `{parameter.name}` required parameter of the operation - `{self.id}`.","messagePattern":"No argument is provided for the `(.+?)` required parameter of the operation - `(.+?)`\\.","errorType":"exception","errorClass":"FunctionExecutionException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py","lineNumber":212,"sourceCode":"    def url_join(self, base_url: str, path: str):\n        \"\"\"Join a base URL and a path, correcting for any missing slashes.\"\"\"\n        parsed_base = urlparse(base_url)\n        base_path = parsed_base.path + \"/\" if not parsed_base.path.endswith(\"/\") else parsed_base.path\n        full_path = urljoin(base_path, path.lstrip(\"/\"))\n        return urlunparse(parsed_base._replace(path=full_path))\n\n    def build_headers(self, arguments: dict[str, Any]) -> dict[str, str]:\n        \"\"\"Build the headers for the operation.\"\"\"\n        headers = {}\n\n        parameters = [p for p in self.parameters if p.location == RestApiParameterLocation.HEADER]\n\n        for parameter in parameters:\n            argument = arguments.get(parameter.name)\n\n            if argument is None:\n                if parameter.is_required:\n                    raise FunctionExecutionException(\n                        f\"No argument is provided for the `{parameter.name}` \"\n                        f\"required parameter of the operation - `{self.id}`.\"\n                    )\n                continue\n\n            headers[parameter.name] = str(argument)\n\n        return headers\n\n    def build_operation_url(self, arguments, server_url_override=None, api_host_url=None):\n        \"\"\"Build the URL for the operation.\"\"\"\n        server_url = self.get_server_url(server_url_override, api_host_url, arguments)\n        path = self.build_path(self.path, arguments)\n        try:\n            request_url = urljoin(server_url, path.lstrip(\"/\"))\n        except Exception as e:\n            raise FunctionExecutionException(f\"Error building the URL for the operation {self.id}: {e!s}\") from e\n        self._ensure_request_target_matches_server(server_url, request_url)","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py#L194-L230","documentation":"When building HTTP headers for a REST API operation call, `build_headers` iterates over parameters located in the HEADER and checks that each required one has a corresponding argument. This FunctionExecutionException is raised when a required header parameter has no value supplied in the arguments dict. Optional header parameters without arguments are silently skipped.","triggerScenarios":"Invoking an OpenAPI operation function without providing a value for a parameter declared as `required: true` in the `header` location. The function arguments dict is missing the key matching the parameter name.","commonSituations":"Calling a generated plugin function and forgetting to pass a required header (e.g. Authorization, X-API-Key). Parameter name in the spec differs from what the caller supplies. The OpenAPI spec marks a header as required but the caller assumes it is optional.","solutions":["Provide a value for every required header parameter named in the error message when calling the operation.","Review the OpenAPI spec to identify all required header parameters and ensure each is supplied.","If the parameter should be optional, correct the OpenAPI spec's `required` field."],"exampleFix":"// before\nresult = await my_api.get_items()  # missing required 'X-API-Key' header\n// after\nresult = await my_api.get_items(x_api_key=\"my-secret-key\")","handlingStrategy":"validation","validationCode":"def validate_required_headers(operation, arguments: dict):\n    required = [p.name for p in operation.parameters\n                if p.location == RestApiParameterLocation.HEADER and p.is_required]\n    missing = [p for p in required if arguments.get(p) is None]\n    if missing:\n        raise ValueError(f\"Missing required header parameters: {missing}\")","typeGuard":null,"tryCatchPattern":"try:\n    result = await api.my_operation(**args)\nexcept FunctionExecutionException as e:\n    if \"required parameter\" in str(e) and \"header\" in str(e).lower():\n        # supply the missing header argument\n        ...","preventionTips":["Review the OpenAPI spec for all required header parameters before calling.","Build a helper that checks arguments against required parameters before invocation.","Pass all required headers explicitly rather than relying on defaults."],"tags":["openapi","rest-api","headers","required-parameter","semantic-kernel"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}