The tool type (e.g., DynamicStructuredTool)
import { tool } from "@langchain/core/tools";
import { z } from "zod";
const getWeather = tool(
async ({ location }) => `Weather in ${location}`,
{ name: "get_weather", schema: z.object({ location: z.string() }) }
);
// Infer: { name: "get_weather"; args: { location: string }; id?: string; type?: "tool_call" }
type WeatherToolCall = ToolCallFromTool<typeof getWeather>;
Infer a tool call type from a single tool. Works with tools created via
tool()from@langchain/core/tools.For DynamicStructuredTool, this extracts the input type from the _call method, which is the most reliable source as it's the pre-computed input type.