[GH-ISSUE #4159] [langchain]: Bad python in Build a custom SQL agent tutorial #2786

Open
opened 2026-06-05 17:26:46 -04:00 by yindo · 0 comments
Owner

Originally created by @wjvz4s9smg-glitch on GitHub (May 25, 2026).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/4159

Type of issue

issue / bug

Language

Python

Description

In the section starting with

Let’s wrap the sql_db_query tool in a node that receives human input. We can implement this using the interrupt function. Below, we allow for input to approve the tool call, edit its arguments, or provide user feedback.

There is the code:

@tool(
    run_query_tool.name,
    description=run_query_tool.description,
    args_schema=run_query_tool.args_schema
)

and when I run, I get the error:

TypeError                                 Traceback (most recent call last)
Cell In[7], line 1
----> 1 @tool(
      2     run_query_tool.name,
      3     description=run_query_tool.description,
      4     args_schema=run_query_tool.args_schema

TypeError: 'StructuredTool' object is not callable

I am using python 3.14.5.

I have a pyproject.toml:

[project]
name="sql_agent"
version="0.1.0"
description="sql_agent"
requires-python=">=3.14.0"
dependencies = [
    "jupyterlab",
    "langchain",
    "langgraph",
    "langchain-openai",
    "langchain_community",
    "duckduckgo-search",
    "requests",
    "sympy"
]

and

$ uv pip list | grep langchain
langchain                 1.3.1
langchain-classic         1.0.7
langchain-community       0.4.2
langchain-core            1.4.0
langchain-openai          1.2.2
langchain-protocol        0.0.15
langchain-text-splitters  1.1.2
Originally created by @wjvz4s9smg-glitch on GitHub (May 25, 2026). Original GitHub issue: https://github.com/langchain-ai/docs/issues/4159 ### Type of issue issue / bug ### Language Python ### Description In the section starting with > Let’s wrap the sql_db_query tool in a node that receives human input. We can implement this using the [interrupt](https://docs.langchain.com/oss/python/langgraph/interrupts) function. Below, we allow for input to approve the tool call, edit its arguments, or provide user feedback. There is the code: ``` @tool( run_query_tool.name, description=run_query_tool.description, args_schema=run_query_tool.args_schema ) ``` and when I run, I get the error: ``` TypeError Traceback (most recent call last) Cell In[7], line 1 ----> 1 @tool( 2 run_query_tool.name, 3 description=run_query_tool.description, 4 args_schema=run_query_tool.args_schema TypeError: 'StructuredTool' object is not callable ``` I am using python 3.14.5. I have a pyproject.toml: ``` [project] name="sql_agent" version="0.1.0" description="sql_agent" requires-python=">=3.14.0" dependencies = [ "jupyterlab", "langchain", "langgraph", "langchain-openai", "langchain_community", "duckduckgo-search", "requests", "sympy" ] ``` and ``` $ uv pip list | grep langchain langchain 1.3.1 langchain-classic 1.0.7 langchain-community 0.4.2 langchain-core 1.4.0 langchain-openai 1.2.2 langchain-protocol 0.0.15 langchain-text-splitters 1.1.2 ```
yindo added the langchainexternal labels 2026-06-05 17:26:46 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#2786