LangChain tools
LangChain tools are utilities designed to be called by language models, with inputs generated by models and outputs returned to models for enhanced functionality. Tools are utilities designed to be called by a model: their inputs are designed to be generated by models, and their outputs are designed to be passed back to models. These tools implement the BaseTool interface, which provides a standardized framework for extending LLM capabilities through external functions, APIs, and services. Tools can be created using the @tool decorator for simple functions or by inheriting from BaseTool for complex implementations. There are two main ways to use tools: chains and agents. Chains lets you create a pre-defined sequence of tool usage(s). Agents let the model use tools in a loop, so that it can decide how many times to use tools. LangChain provides extensive libraries of pre-built tools for common tasks like web search, calculators, and database queries, while supporting custom tool development for specialized requirements in agentic workflows.