{"record":{"id":"6daedb96808ae3fa","repo":"langchain-ai/langgraph","slug":"entrypoint-function-must-have-at-least-one-paramet","errorCode":null,"errorMessage":"Entrypoint function must have at least one parameter","messagePattern":"Entrypoint function must have at least one parameter","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/langgraph/langgraph/func/__init__.py","lineNumber":538,"sourceCode":"            func: The function to convert. Support both sync and async functions.\n\n        Returns:\n            A Pregel graph.\n        \"\"\"\n        # wrap generators in a function that writes to StreamWriter\n        if inspect.isgeneratorfunction(func) or inspect.isasyncgenfunction(func):\n            raise NotImplementedError(\n                \"Generators are not supported in the Functional API.\"\n            )\n\n        bound = get_runnable_for_entrypoint(func)\n        stream_mode: StreamMode = \"updates\"\n\n        # get input and output types\n        sig = inspect.signature(func)\n        first_parameter_name = next(iter(sig.parameters.keys()), None)\n        if not first_parameter_name:\n            raise ValueError(\"Entrypoint function must have at least one parameter\")\n        input_type = (\n            sig.parameters[first_parameter_name].annotation\n            if sig.parameters[first_parameter_name].annotation\n            is not inspect.Signature.empty\n            else Any\n        )\n\n        def _pluck_return_value(value: Any) -> Any:\n            \"\"\"Extract the return_ value the entrypoint.final object or passthrough.\"\"\"\n            return value.value if isinstance(value, entrypoint.final) else value\n\n        def _pluck_save_value(value: Any) -> Any:\n            \"\"\"Get save value from the entrypoint.final object or passthrough.\"\"\"\n            return value.save if isinstance(value, entrypoint.final) else value\n\n        output_type, save_type = Any, Any\n        if sig.return_annotation is not inspect.Signature.empty:\n            # User does not parameterize entrypoint.final properly","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/langgraph/langgraph/func/__init__.py#L520-L556","documentation":"Raised when converting a function to an entrypoint and the function signature has zero parameters — an entrypoint must accept at least one argument (typically the input/state) so the runtime can invoke it.","triggerScenarios":"Thrown at libs/langgraph/langgraph/func/__init__.py:538 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add at least one parameter to the entrypoint function, e.g. `def main(state: State):`","Use a lambda/partial to supply a dummy parameter if the function genuinely needs no input"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}