SqlToolkit toolkits. For more information, you can also review the Python SQL toolkit documentation.
This toolkit contains a the following tools:
This toolkit is useful for asking questions, performing queries, validating queries and more on a SQL database.
Setup
This example uses Chinook database, which is a sample database available for SQL Server, Oracle, MySQL, etc. To set it up, follow these instructions, placing the.db file in the directory where your code lives.
If you want to get automated tracing from runs of individual tools, you can also set your LangSmith API key by uncommenting below:
Installation
This toolkit lives in thelangchain package. You’ll also need to install the typeorm peer dependency.
Instantiation
First, we need to define our LLM to be used in the toolkit.Tools
View available tools:Use within an agent
First, ensure you have LangGraph installed:Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

