last_failed_tool_arg and last_tool_error_code) so any failed booking or lookup writes the rejected field name and status code directly to the contact record.
{{contact.last_failed_tool_arg}} before calling any action and caps identical tool retries at 2 attempts, asking the contact for a corrected phone number, email, or date whenever a 400 or 422 validation error occurs.
Off, applies the tool-retry-limit tag, and routes the thread to Conversations > Team Inbox when a tool call fails twice or the target field does not change.
Prevent repeated AI agent tool failures and retry loops in sub-account <YOUR_LOCATION_ID>: 1. In Settings > Custom Fields, create last_failed_tool_arg and last_tool_error_code fields on the Contact object to persist failed parameters across turns. 2. In AI Agents > Conversation AI, cap tool retries at 2 attempts, allow retries only on 429/503 timeouts, and ask the user to correct the field when a 400/422 validation error is logged. 3. In Automation > Workflow Builder, turn Conversation AI Off and notify Conversations > Team Inbox if a second attempt fails or target contact fields do not change.
# Audit custom fields and tool failure escalation workflows in the sub-account ghl-crm custom-fields list --context <YOUR_CONTEXT> --location <YOUR_LOCATION_ID> ghl-crm workflows list --context <YOUR_CONTEXT> --location <YOUR_LOCATION_ID>
Official GHL MCP vs. ghl-tools: HighLevel’s official hosted MCP (services.leadconnectorhq.com/mcp) covers public v2 CRM records (contacts, opportunities, appointments, conversations). ghl-tools MCP complements it with workflow graph inspection & recipes, funnel/form builders, DNS/BIMI checks, and ghl-crm doctor audits.
2 attempts in AI Agents > Conversation AI (retrying only transient 429 or 503 timeouts)| Step | Menu Path in GHL | Action |
|---|---|---|
| Step 1 | Settings > Custom Fields | Create two text fields on the Contact object (last_failed_tool_arg and last_tool_error_code) so any failed booking or lookup writes the rejected field name and status code directly to the contact record. |
| Step 2 | AI Agents > Conversation AI | Add a system prompt instruction that checks {{contact.last_failed_tool_arg}} before calling any action and caps identical tool retries at 2 attempts, asking the contact for a corrected phone number, email, or date whenever a 400 or 422 validation error occurs. |
| Step 3 | Automation > Workflow Builder | Add an If/Else check on the error branch that turns Conversation AI status to Off, applies the tool-retry-limit tag, and routes the thread to Conversations > Team Inbox when a tool call fails twice or the target field does not change. |
Connect Claude Code, Cursor, or OpenAI Codex to our ghl-tools MCP Server & Rust CLI to build workflows, forms, and funnels from your editor, or start your GoHighLevel plan through our partner link to unlock $612+ in ready-to-import kits (including GHL AI Agent Error Recovery & Loop Guard Kit) and weekly live clinics.