tool2agent API Documentation - v0.0.0
    Preparing search index...

    Type Alias MiddlewareOptions<InputType, OutputType, NewInputType, NewOutputType>

    Options for configuring middleware transformations. Uses a single transform function that transforms a Tool2Agent into another Tool2Agent, ensuring type alignment between execute function and input schema.

    type MiddlewareOptions<
        InputType,
        OutputType,
        NewInputType = InputType,
        NewOutputType = OutputType,
    > = {
        transform: (
            tool: Tool2Agent<InputType, OutputType>,
        ) => Tool2Agent<NewInputType, NewOutputType>;
    }

    Type Parameters

    • InputType

      The input type of the original tool

    • OutputType

      The output type of the original tool

    • NewInputType = InputType

      The input type of the transformed tool (defaults to InputType)

    • NewOutputType = OutputType

      The output type of the transformed tool (defaults to OutputType)

    Index

    Properties

    Properties

    Transform the tool into a new tool. This method ensures type alignment between the execute function and input schema.

    Type Declaration