AI SWAIG tool webhook

View as MarkdownOpen in Claude
Sent to a tool's `web_hook_url` (or the SWAIG `defaults.web_hook_url`) when an [`ai`](/docs/swml/reference/calling/ai) agent calls one of your functions. Your endpoint runs the function and replies with a JSON object — the same shape a `data_map` output produces, because the platform reads both the same way. Every field is optional, so `{}` is a valid reply and a handler that only steers the call can return `action` alone: - `response` — the result the agent reads next, written to the AI rather than spoken to the caller. A plain string becomes the tool message as-is; the object form `{tool_result, tool_prompt}` splits the data half from the steering half. Omit it and the agent reads a default result. - `action` — a single action object or an array of them, executed on the live call. - `post_process` — hold the actions until after the agent has spoken. **Default:** `false`.