LangChain custom tools

LangChain custom tools are user-defined Python functions wrapped by the @tool decorator so a large language model (LLM) agent can call them autonomously. Each tool exposes a name , description , and argument schema —often a Pydantic model—allowing the LLM to select it through natural-language reasoning (ReAct). Under the hood, LangChain serializes the call as JSON, validates inputs, executes the function (API query, SQL statement, shell command, or proprietary logic), and streams the result back into the prompt loop. Tools can be synchronous or async, stateless or stateful, and can carry rate limiting or PII redaction written into the tool function itself, since LangChain provides neither for tools out of the box. Because they follow a standard interface, custom tools plug into agents built with create_agent, or into tool nodes in a LangGraph graph, without modifying core logic. This plug-and-play design lets teams turn domain knowledge and legacy systems into callable skills, enabling LLMs to fetch live data, write Jira tickets, or trigger cloud workflows while keeping codebases clean and testable.

Work with us

Ready to put agentic AI to work?

Book a free 45-minute consultation. We'll map one real process worth automating with production-grade AI.