Cannot access ToolRuntime in BaseTool subclass

hi @sammyne

when you use args_schema and want to access the runtime, all you need is to define it on the args schema class like this:

class MultiplyInput(BaseModel):
    a: int = Field(description="first number")
    b: int = Field(description="second number")
    runtime: ToolRuntime  # injected by ToolNode, internally

which means the class must be aligned with the arguments of the _run method.

See that post How to access tool call id using runtime - #2 by pawel-twardziak