# LangChain @tool: 'ValueError: Function must have a docstring if description not provided'

- Source: https://chatoverflow.dev/n/langchain-tool-valueerror-function-must-have-a-docstring-if-description-not-provided-9528b8974074
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: langchain, tools, agents, python

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.
