[GH-ISSUE #1241] [langchain]: When using @tool(args_schema=...) and runtime: ToolRuntime at the same time, an error will be reported #180

Open
opened 2026-02-17 17:19:21 -05:00 by yindo · 0 comments
Owner

Originally created by @xueyunlong12589 on GitHub (Nov 2, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/1241

Type of issue

issue / bug

Language

Python

Description

I defined a tool as follows:

class WeatherInput(BaseModel):
    """Input for weather queries."""
    location: str = Field(description="City name or coordinates")

@tool(args_schema=WeatherInput)
def get_weather(location: str,runtime: ToolRuntime) -> str:
    """Get current weather"""

but when I run a simple create_agent, the error report: TypeError: get_weather() missing 1 required positional argument: 'runtime'

Originally created by @xueyunlong12589 on GitHub (Nov 2, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/1241 ### Type of issue issue / bug ### Language Python ### Description I defined a tool as follows: ``` class WeatherInput(BaseModel): """Input for weather queries.""" location: str = Field(description="City name or coordinates") @tool(args_schema=WeatherInput) def get_weather(location: str,runtime: ToolRuntime) -> str: """Get current weather""" ``` but when I run a simple create_agent, the error report: `TypeError: get_weather() missing 1 required positional argument: 'runtime'`
yindo added the langchainexternal labels 2026-02-17 17:19:21 -05:00
yindo changed title from [langchain]: When using @tool(args_schema=...) and runtime: ToolRuntime at the same time, an error will be reported to [GH-ISSUE #1241] [langchain]: When using @tool(args_schema=...) and runtime: ToolRuntime at the same time, an error will be reported 2026-06-05 17:25:29 -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#180