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
| Name | Type | Description |
|---|---|---|
toolName | string | Required. Tool name (^[a-z0-9_]+$). |
Body Parameters
| Name | Type | Description |
|---|---|---|
params | Record | Second argument. Tool input, sent as the JSON body. Defaults to {}. Shape is the tool's inputSchema. Dangerous retries may include confirmationCode. |
Options
| Name | Type | Description |
|---|---|---|
autoConfirm | boolean | Third-argument option. When true and the first error is confirmation_required, the SDK POSTs again with confirmationCode from error.details. |
Response Fields
| Field | Type | Description |
|---|---|---|
| (tool-specific) | T | HTTP 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 } }.