@mendix/extensions-api - v0.11.5
    Preparing search index...

    Type Alias ExternalAIToolDefinition

    Tool definition available to external extensions.

    type ExternalAIToolDefinition = {
        description: string | (() => Promise<string>);
        inProgressMessage?: string | ((input?: unknown) => Promise<string>);
        inputSchema: JSONObject;
        name: string;
        run: (input: object) => Promise<string>;
    }
    Index

    Properties

    description: string | (() => Promise<string>)

    The tool's description. It should be a few lines paragraph explaining the details on how the tool is used. It should clearly describe non-intuitive behavior the tool might have, or any necessary rules needed to be followed when using the tool.

    inProgressMessage?: string | ((input?: unknown) => Promise<string>)

    Text shown in the UI while the tool is running.

    The same input object passed to the tool. Can be used to customize the message based on the input. If omitted, a default message is shown.

    inputSchema: JSONObject

    The input schema for the tool, defined as a JSON Schema. This schema describes the input and it will be used to validate the input parameters. It is recommended to use zod to define the schema, and then use z.toJSONSchema to convert it to a JSON schema.

    name: string

    The tool name as it is given to the LLM. It must be descriptive and not contain any special characters, since different LLMs have different restrictions on tool names.

    run: (input: object) => Promise<string>

    The code that runs when the tool is executed. The input object needs to conform to the input schema defined in the tool definition.