Execute Tool

Run a Lumail tool by name.

MethodPOST
/api/v2/tools/:toolName

Runs 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

NameTypeDescription
toolNamestringRequired. Tool name.

Body Parameters

NameTypeDescription
(tool fields)variesFields from the tool inputSchema. Example list_subscribers: limit, status, tag, query, cursor.
confirmationCodeintegerRequired on the retry after confirmation_required.

Options

NameTypeDescription
autoConfirmbooleanSDK-only. When true, tools.run retries once with confirmationCode. HTTP clients send confirmationCode themselves. Default false.

Response Fields

FieldTypeDescription
(tool output)objectTool-specific JSON. Not wrapped in { success: true }.

confirmation_required error fields:

FieldTypeDescription
name"confirmation_required"Error name.
messagestringWhy confirmation is required.
statusCode403HTTP status.
details.actionstringTool / action name.
details.confirmationCodeintegerCode to send back.
details.instructionstringHow to confirm.

Errors

StatusnameWhen
401missing_api_keyMissing or invalid bearer token
403missing_permissionToken lacks the tool's permission
403confirmation_requiredDangerous tool needs confirmationCode
404not_foundUnknown tool name
400validation_errorInvalid tool input