langchain.js
    Preparing search index...

    Interface DynamicStructuredToolInput<SchemaT, SchemaOutputT, ToolOutputT>

    Interface for the input parameters of the DynamicStructuredTool class.

    interface DynamicStructuredToolInput<
        SchemaT = ToolSchemaBase,
        SchemaOutputT = ToolInputSchemaOutputType<SchemaT>,
        ToolOutputT = ToolOutputType,
    > {
        callbacks?: Callbacks;
        defaultConfig?: ToolRunnableConfig<Record<string, any>, any>;
        description: string;
        func: (
            input: SchemaOutputT,
            runManager?: CallbackManagerForToolRun,
            config?: RunnableConfig<Record<string, any>>,
        ) => Promise<ToolOutputT>;
        metadata?: Record<string, unknown>;
        name: string;
        responseFormat?: string;
        returnDirect?: boolean;
        schema: SchemaT;
        tags?: string[];
        verbose?: boolean;
        verboseParsingErrors?: boolean;
    }

    Type Parameters

    • SchemaT = ToolSchemaBase

      The type of the tool input schema. Usually you don't need to specify this.

    • SchemaOutputT = ToolInputSchemaOutputType<SchemaT>

      The TypeScript type representing the result of applying the schema to the tool arguments. Useful for type checking tool handler functions when using JSONSchema.

    • ToolOutputT = ToolOutputType

    Hierarchy (View Summary)

    Index

    Properties

    callbacks?: Callbacks
    defaultConfig?: ToolRunnableConfig<Record<string, any>, any>

    Default config object for the tool runnable.

    description: string
    func: (
        input: SchemaOutputT,
        runManager?: CallbackManagerForToolRun,
        config?: RunnableConfig<Record<string, any>>,
    ) => Promise<ToolOutputT>

    Tool handler function - the function that will be called when the tool is invoked.

    Type Declaration

    metadata?: Record<string, unknown>
    name: string
    responseFormat?: string

    The tool response format.

    If "content" then the output of the tool is interpreted as the contents of a ToolMessage. If "content_and_artifact" then the output is expected to be a two-tuple corresponding to the (content, artifact) of a ToolMessage.

    "content"
    
    returnDirect?: boolean

    Whether to return the tool's output directly.

    Setting this to true means that after the tool is called, an agent should stop looping.

    schema: SchemaT
    tags?: string[]
    verbose?: boolean
    verboseParsingErrors?: boolean

    Whether to show full details in the thrown parsing errors.

    false