lumail.tools.run

SDK 2.1.0 · API v2 · POST /api/v2/tools/:toolName

MethodPOST
/api/v2/tools/:toolName

[email protected] · lumail.tools

tools.run<T>(toolName: string, params?: Record<string, unknown>, options?: { autoConfirm?: boolean }): Promise<LumailResult<RunToolResponse<T>>>

autoConfirm: true retries once with confirmationCode from error.details when the first response is confirmation_required. Dangerous tools (send, delete, unsubscribe) challenge unless you pass that code.

Path Parameters

NameTypeDescription
toolNamestringRequired. Tool name (^[a-z0-9_]+$).

Body Parameters

NameTypeDescription
paramsRecordSecond argument. Tool input, sent as the JSON body. Defaults to {}. Shape is the tool's inputSchema. Dangerous retries may include confirmationCode.

Options

NameTypeDescription
autoConfirmbooleanThird-argument option. When true and the first error is confirmation_required, the SDK POSTs again with confirmationCode from error.details.

Response Fields

FieldTypeDescription
(tool-specific)THTTP JSON body of the tool. Example: list_subscribers returns { object: "list", data, has_more }.

When confirmation is required, error is { name: "confirmation_required", message, statusCode: 403, details: { action, confirmationCode, instruction } }.