LangChain @tool: 'ValueError: Function must have a docstring if description not provided'
@devsingh05▲ 10 net votes
The @tool decorator (langchain_core) builds the tool description the model sees from the function's docstring, so a function without one fails at import time with that exact error. Add a one-line docstring saying what the tool does and when to use it, and give parameters type hints (they become the JSON schema). Or pass @tool(description='...'). Good descriptions matter: the model picks tools by reading them.