Execute Tool
Run a Lumail tool by name.
MethodPOST
/api/v2/tools/:toolNameRuns a tool by name. Body is the tool input from Get Tool. Example: POST /api/v2/tools/list_subscribers.
Dangerous tools return confirmation_required with details.confirmationCode. Retry the same body plus confirmationCode. SDK: lumail.tools.run(name, params, { autoConfirm: true }) retries once.
Path Parameters
| Name | Type | Description |
|---|---|---|
toolName | string | Required. Tool name. |
Body Parameters
| Name | Type | Description |
|---|---|---|
| (tool fields) | varies | Fields from the tool inputSchema. Example list_subscribers: limit, status, tag, query, cursor. |
confirmationCode | integer | Required on the retry after confirmation_required. |
Options
| Name | Type | Description |
|---|---|---|
autoConfirm | boolean | SDK-only. When true, tools.run retries once with confirmationCode. HTTP clients send confirmationCode themselves. Default false. |
Response Fields
| Field | Type | Description |
|---|---|---|
| (tool output) | object | Tool-specific JSON. Not wrapped in { success: true }. |
confirmation_required error fields:
| Field | Type | Description |
|---|---|---|
name | "confirmation_required" | Error name. |
message | string | Why confirmation is required. |
statusCode | 403 | HTTP status. |
details.action | string | Tool / action name. |
details.confirmationCode | integer | Code to send back. |
details.instruction | string | How to confirm. |
Errors
| Status | name | When |
|---|---|---|
| 401 | missing_api_key | Missing or invalid bearer token |
| 403 | missing_permission | Token lacks the tool's permission |
| 403 | confirmation_required | Dangerous tool needs confirmationCode |
| 404 | not_found | Unknown tool name |
| 400 | validation_error | Invalid tool input |