Lunara Voice AI — Complete Agent Tool Guide
You have full access to the Lunara Voice AI platform through 33 tools organized into two API modules:
- Core API (15 tools): Agent management, campaigns, calls, API keys
- History & Analytics API (18 tools): Call history, transcripts, analytics dashboards, LLM export, tags, webhooks
All Available Tools
Core Tools (Agent Management & Calls)
| Tool |
Purpose |
lunara_health |
Check if the Lunara API is online |
lunara_agents_list |
List all voice agents |
lunara_agent_get |
Get agent details (prompt, voice, balance) |
lunara_agent_update |
Update agent config (prompt, voice, greeting, SIP) |
lunara_campaign_create |
Create a call campaign with contacts |
lunara_campaign_list |
List all campaigns |
lunara_campaign_get |
Get campaign progress/status |
lunara_campaign_start |
Start a campaign's call loop |
lunara_campaign_stop |
Stop (pause) a running campaign |
lunara_call_single |
Make a single outbound call |
lunara_key_create |
Create a new API key |
lunara_key_list |
List API keys |
lunara_key_revoke |
Revoke an API key |
lunara_key_delete |
Permanently delete an API key |
lunara_docs |
Fetch Core API documentation JSON |
History & Transcript Tools
| Tool |
Purpose |
lunara_history_health |
Check ClawBot History API health & features |
lunara_history_list |
Get paginated call history with rich filters |
lunara_history_detail |
Get full call detail + transcript + tags |
lunara_history_search |
Search call transcripts by text/keyword |
LLM Export Tools
| Tool |
Purpose |
lunara_export_single |
Export one conversation in LLM format (openai/training/raw) |
lunara_export_bulk |
Bulk export conversations for LLM training |
Analytics Tools
| Tool |
Purpose |
lunara_analytics_dashboard |
Full analytics: call stats, sentiment, topics, daily trends |
lunara_analytics_save |
Save AI analysis for a conversation (sentiment, summary, etc.) |
lunara_analytics_batch |
Batch save analytics for multiple conversations |
Tagging Tools
| Tool |
Purpose |
lunara_tags_add |
Add tags to a conversation (manual/auto/ai) |
lunara_tags_remove |
Remove a tag from a conversation |
Webhook Tools
| Tool |
Purpose |
lunara_webhook_create |
Create webhook for real-time call event notifications |
lunara_webhook_list |
List all webhook subscriptions |
lunara_webhook_update |
Update webhook URL/events/status |
lunara_webhook_delete |
Delete a webhook |
lunara_webhook_test |
Test webhook connectivity |
lunara_webhook_deliveries |
View webhook delivery log |
Documentation
| Tool |
Purpose |
lunara_clawbot_docs |
Fetch full ClawBot History API docs (OpenAPI 3.0) |
Typical Workflows
1. View and manage agents
lunara_agents_list — see all configured agents
lunara_agent_get with assistant_id — check details, prompt, minute balance
lunara_agent_update — change prompt, voice, greeting, language, or SIP config
2. Run a call campaign
lunara_agents_list — pick an agent
lunara_agent_get — verify the agent has minutes
lunara_campaign_create — upload contacts (phone numbers or objects with name/metadata)
lunara_campaign_start — begin calling
lunara_campaign_get — monitor progress (processed, successful, failed counts)
lunara_campaign_stop — pause if needed
3. Quick single call
⚠️ There is NO "fire and forget" call flow. Every single outbound call MUST follow the full end-to-end workflow in Section 5 below — including polling for completion and reporting transcript results. Never just call lunara_call_single and stop.
4. Review call results after a call or campaign
lunara_history_list with assistant_id — see recent calls
lunara_history_detail with conversation_id — get full transcript
lunara_analytics_save — save your analysis (sentiment, summary, quality)
lunara_tags_add — tag the call (e.g. "interested", "follow-up", "vip")
5. Make a call and report the result (end-to-end) — DEFAULT FOR ALL CALLS
⚠️ AUTONOMOUS EXECUTION — This workflow applies to EVERY outbound call, no exceptions!
Whenever the user asks to call someone — regardless of phrasing ("позвони", "набери", "call", "договорись", "сделай звонок", etc.) — you MUST complete ALL steps below in ONE turn. Never just initiate a call and stop.
- Record the current timestamp (ISO 8601, e.g.
2026-02-16T19:45:00Z) and the phone number you are calling BEFORE making the call. You will need these to find the NEW call record.
lunara_call_single — place the call. Save the returned Call SID.
- Poll until THE NEW call completes — call
lunara_history_list with date_from=<timestamp from step 1> and caller=<phone_number> every 25-30 seconds. You MUST use date_from to exclude old calls. Keep polling until a record appears that matches the phone number AND was created AFTER step 1's timestamp (up to 5 minutes / 10 attempts). Do NOT message the user — poll silently.
lunara_history_detail with include_transcript=true and the conversation_id from the NEW record (not the first/latest random record!) — read the full transcript.
lunara_analytics_save — record sentiment, summary, outcome
lunara_tags_add — categorize the result
- Report final result to user — summarize: who answered, what was discussed, what was agreed, next steps. Include key quotes from transcript.
⚠️ CRITICAL BUG PREVENTION:
- NEVER grab the first record from
lunara_history_list without checking date_from and phone number match
- Old call records will appear in history — you MUST filter them out using
date_from=<timestamp before call>
- If you report results from a call that happened BEFORE
lunara_call_single, you are reporting the WRONG call
- Always verify: does the transcript mention the topic/context of THIS call, not some previous call?
CRITICAL: ANY request to make a call — "позвони", "набери номер", "договорись", "сделай звонок", "call", "ring", "negotiate", etc. — MUST trigger ALL 7 steps automatically. The user ALWAYS expects to see the call outcome in the same response. Never stop after step 2 to say "call initiated" and wait. Never report results before the call has finished — the transcript won't exist yet and you'll get wrong/empty data.
6. Analytics overview
lunara_analytics_dashboard with assistant_id — get full statistics
- Review: total calls, sentiment distribution, top topics, resolution rates, peak hours
- Use date_from/date_to for time-bounded analysis
7. Search through call history
lunara_history_search with search_text — find calls mentioning specific keywords
lunara_history_detail — drill into matching calls for full transcript
8. Export data for AI training
lunara_export_single — export one call in openai/training/raw format
lunara_export_bulk — bulk export multiple calls with filters
9. Set up webhook notifications
lunara_webhook_create — subscribe to events (e.g. call.completed)
lunara_webhook_test — verify connectivity
lunara_webhook_list — see all subscriptions
lunara_webhook_deliveries — check delivery log for debugging
10. API key management
lunara_key_list — see existing keys
lunara_key_create — generate a new key (save it immediately!)
lunara_key_revoke — disable a key
lunara_key_delete — remove permanently
Important Notes
- Voices: alloy, ash, ballad, coral, echo, sage, shimmer, verse, marin, cedar
- Phone format: 7-15 digits, optional leading
+ (e.g. +12125551234)
- Max contacts per campaign: 10,000
- Minute balance: Check before starting campaigns. If balance is 0, calls will fail with 402.
- Campaign statuses: pending → running → completed/paused/failed
- PII masking: Call history and exports support PII masking (on by default). Set mask_pii=false to get raw data.
- LLM export formats:
openai (Chat Completions), training (JSONL fine-tuning), raw (full JSON)
- Sentiment labels: positive, neutral, negative, mixed
- Resolution statuses: resolved, unresolved, escalated, pending
- Webhook events: call.started, call.completed, call.failed, analysis.completed, campaign.started, campaign.completed, campaign.failed
- Webhook URLs: Must be HTTPS. Auto-disabled after 10 consecutive failures.
- Tag sources: manual, auto, ai (max 50 tags per conversation)
- API keys are shown only once at creation. Always save them immediately.
History Filter Reference
The lunara_history_list tool supports these filters (all optional):
| Filter |
Type |
Description |
date_from |
ISO 8601 string |
Start of date range |
date_to |
ISO 8601 string |
End of date range |
direction |
"inbound" / "outbound" |
Call direction |
caller |
string |
Partial match on caller number |
did |
string |
Partial match on DID |
min_duration |
integer |
Minimum call duration (seconds) |
max_duration |
integer |
Maximum call duration (seconds) |
has_audio |
boolean |
Has audio recording |
sentiment |
string |
positive/neutral/negative/mixed |
resolution_status |
string |
resolved/unresolved/escalated/pending |
tags |
comma-separated |
Filter by tags |
search_text |
string |
Full-text search in transcripts |
mask_pii |
boolean |
Mask personal info (default true) |
Example User Requests → Tool Mapping
Agent & Call Management
- "Show my agents" →
lunara_agents_list
- "What voice does agent X use?" →
lunara_agent_get(assistant_id=X)
- "Change voice to coral" →
lunara_agent_update(assistant_id=X, voice="coral")
- "Update the prompt" →
lunara_agent_update(assistant_id=X, prompt="...")
- "Call +12125551234" →
lunara_call_single(to_number="+12125551234", assistant_id=X)
- "How many minutes left?" →
lunara_agent_get(assistant_id=X) → check minutes_balance
Campaign Management
- "Create campaign with numbers +123, +456" →
lunara_campaign_create(assistant_id=X, contacts=["+123","+456"])
- "Start campaign abc" →
lunara_campaign_start(campaign_id="abc")
- "Campaign status" →
lunara_campaign_get(campaign_id="abc")
- "Stop campaign" →
lunara_campaign_stop(campaign_id="abc")
Call History & Transcripts
- "Show recent calls" →
lunara_history_list(assistant_id=X)
- "Show last 10 calls" →
lunara_history_list(assistant_id=X, page_size=10)
- "Show call details" →
lunara_history_detail(assistant_id=X, conversation_id=Y)
- "What was said in the last call?" →
lunara_history_list → get ID → lunara_history_detail
- "Show inbound calls only" →
lunara_history_list(assistant_id=X, direction="inbound")
- "Calls from today" →
lunara_history_list(assistant_id=X, date_from="2026-02-16T00:00:00Z")
- "Find calls about pricing" →
lunara_history_search(assistant_id=X, search_text="pricing")
- "Show calls longer than 5 minutes" →
lunara_history_list(assistant_id=X, min_duration=300)
- "Show calls with negative sentiment" →
lunara_history_list(assistant_id=X, sentiment="negative")
Analytics
- "Show analytics" →
lunara_analytics_dashboard(assistant_id=X)
- "Call statistics for last week" →
lunara_analytics_dashboard(assistant_id=X, date_from=..., date_to=...)
- "What topics come up most?" →
lunara_analytics_dashboard → check top_topics
- "Save analysis for this call" →
lunara_analytics_save(assistant_id=X, conversation_id=Y, sentiment_label="positive", summary="...")
- "How many resolved calls?" →
lunara_analytics_dashboard → check resolution_distribution
Tags
- "Tag this call as VIP" →
lunara_tags_add(assistant_id=X, conversation_id=Y, tags=["vip"])
- "Add tags: follow-up, interested" →
lunara_tags_add(assistant_id=X, conversation_id=Y, tags=["follow-up","interested"])
- "Remove the urgent tag" →
lunara_tags_remove(assistant_id=X, conversation_id=Y, tag="urgent")
Export
- "Export this call for training" →
lunara_export_single(assistant_id=X, conversation_id=Y, format="training")
- "Export all calls in OpenAI format" →
lunara_export_bulk(assistant_id=X, format="openai")
- "Export last 50 positive calls" →
lunara_export_bulk(assistant_id=X, limit=50, sentiment="positive")
Webhooks
- "Set up webhook for call completions" →
lunara_webhook_create(url="https://...", events=["call.completed"])
- "Show webhooks" →
lunara_webhook_list
- "Test webhook" →
lunara_webhook_test(webhook_id=X)
- "Pause webhook" →
lunara_webhook_update(webhook_id=X, status="paused")
- "Delete webhook" →
lunara_webhook_delete(webhook_id=X)
- "Show webhook delivery log" →
lunara_webhook_deliveries(webhook_id=X)
System
- "Is the API working?" →
lunara_health
- "Is history API working?" →
lunara_history_health
- "Show API keys" →
lunara_key_list
- "Create key named production" →
lunara_key_create(name="production")
⚠️ Autonomous Execution Rules — APPLY TO EVERY OUTBOUND CALL
Every outbound call (lunara_call_single or campaign) MUST complete the entire workflow in a single turn. There are no exceptions — the user should NEVER have to ask "what happened?" separately:
- Do NOT stop after initiating the call to say "Call started, SID: xxx" and wait
- Do NOT ask the user "should I check the results now?"
- Do NOT search for the transcript while the call is still active — it doesn't exist yet!
- Poll
lunara_history_list silently every 25-30 seconds until the call record appears as completed (max 5 minutes / 10 attempts)
- Only AFTER the call record appears as completed, fetch
lunara_history_detail with transcript
- Present ONLY the final summary: outcome, key points, agreements, next steps
Polling pattern (MUST use date_from to avoid reporting old calls):
call_start_time = current ISO 8601 timestamp (BEFORE lunara_call_single)
called_number = the phone number being called
call_sid = result of lunara_call_single
# IMPORTANT: Wait at least 30 seconds before the FIRST poll!
# The call needs time to connect and complete.
wait 30 seconds
loop (max 10 attempts, 25-30 sec apart):
result = lunara_history_list(
assistant_id=X,
page_size=5,
date_from=call_start_time, # ← MANDATORY! Filters out all old calls
caller=called_number # ← MANDATORY! Matches the specific number
)
for each record in result:
if record.created_at > call_start_time AND record matches called_number:
# Verify the call status is "completed" (not "in-progress")
if record.status == completed:
→ this is the NEW completed call, use its conversation_id
break
else:
# Call still in progress, keep polling
wait 25-30 seconds
else:
wait 25-30 seconds
⚠️ CRITICAL BUGS TO AVOID:
- If you skip date_from, you WILL get old call records and report wrong results!
- If you fetch the transcript while the call is still active, you'll get incomplete/empty data — ALWAYS wait for status=completed!
- If you report results without polling, you're reporting STALE data from a previous call!
The user expects ONE response with the complete call result, not a multi-message back-and-forth asking them to wait or confirm each step.
1---2name: lunara-voice3description: Manage Lunara Voice AI — agents, campaigns, outbound calls, call history, analytics, webhooks, tags, and LLM data export4---56# Lunara Voice AI — Complete Agent Tool Guide78You have full access to the Lunara Voice AI platform through **33 tools** organized into two API modules:910- **Core API** (15 tools): Agent management, campaigns, calls, API keys11- **History & Analytics API** (18 tools): Call history, transcripts, analytics dashboards, LLM export, tags, webhooks1213## All Available Tools1415### Core Tools (Agent Management & Calls)1617| Tool | Purpose |18|------|---------|19| `lunara_health` | Check if the Lunara API is online |20| `lunara_agents_list` | List all voice agents |21| `lunara_agent_get` | Get agent details (prompt, voice, balance) |22| `lunara_agent_update` | Update agent config (prompt, voice, greeting, SIP) |23| `lunara_campaign_create` | Create a call campaign with contacts |24| `lunara_campaign_list` | List all campaigns |25| `lunara_campaign_get` | Get campaign progress/status |26| `lunara_campaign_start` | Start a campaign's call loop |27| `lunara_campaign_stop` | Stop (pause) a running campaign |28| `lunara_call_single` | Make a single outbound call |29| `lunara_key_create` | Create a new API key |30| `lunara_key_list` | List API keys |31| `lunara_key_revoke` | Revoke an API key |32| `lunara_key_delete` | Permanently delete an API key |33| `lunara_docs` | Fetch Core API documentation JSON |3435### History & Transcript Tools3637| Tool | Purpose |38|------|---------|39| `lunara_history_health` | Check ClawBot History API health & features |40| `lunara_history_list` | Get paginated call history with rich filters |41| `lunara_history_detail` | Get full call detail + transcript + tags |42| `lunara_history_search` | Search call transcripts by text/keyword |4344### LLM Export Tools4546| Tool | Purpose |47|------|---------|48| `lunara_export_single` | Export one conversation in LLM format (openai/training/raw) |49| `lunara_export_bulk` | Bulk export conversations for LLM training |5051### Analytics Tools5253| Tool | Purpose |54|------|---------|55| `lunara_analytics_dashboard` | Full analytics: call stats, sentiment, topics, daily trends |56| `lunara_analytics_save` | Save AI analysis for a conversation (sentiment, summary, etc.) |57| `lunara_analytics_batch` | Batch save analytics for multiple conversations |5859### Tagging Tools6061| Tool | Purpose |62|------|---------|63| `lunara_tags_add` | Add tags to a conversation (manual/auto/ai) |64| `lunara_tags_remove` | Remove a tag from a conversation |6566### Webhook Tools6768| Tool | Purpose |69|------|---------|70| `lunara_webhook_create` | Create webhook for real-time call event notifications |71| `lunara_webhook_list` | List all webhook subscriptions |72| `lunara_webhook_update` | Update webhook URL/events/status |73| `lunara_webhook_delete` | Delete a webhook |74| `lunara_webhook_test` | Test webhook connectivity |75| `lunara_webhook_deliveries` | View webhook delivery log |7677### Documentation7879| Tool | Purpose |80|------|---------|81| `lunara_clawbot_docs` | Fetch full ClawBot History API docs (OpenAPI 3.0) |8283---8485## Typical Workflows8687### 1. View and manage agents881. `lunara_agents_list` — see all configured agents892. `lunara_agent_get` with assistant_id — check details, prompt, minute balance903. `lunara_agent_update` — change prompt, voice, greeting, language, or SIP config9192### 2. Run a call campaign931. `lunara_agents_list` — pick an agent942. `lunara_agent_get` — verify the agent has minutes953. `lunara_campaign_create` — upload contacts (phone numbers or objects with name/metadata)964. `lunara_campaign_start` — begin calling975. `lunara_campaign_get` — monitor progress (processed, successful, failed counts)986. `lunara_campaign_stop` — pause if needed99100### 3. Quick single call101102**⚠️ There is NO "fire and forget" call flow.** Every single outbound call MUST follow the full end-to-end workflow in **Section 5** below — including polling for completion and reporting transcript results. Never just call `lunara_call_single` and stop.103104### 4. Review call results after a call or campaign1051. `lunara_history_list` with assistant_id — see recent calls1062. `lunara_history_detail` with conversation_id — get full transcript1073. `lunara_analytics_save` — save your analysis (sentiment, summary, quality)1084. `lunara_tags_add` — tag the call (e.g. "interested", "follow-up", "vip")109110### 5. Make a call and report the result (end-to-end) — DEFAULT FOR ALL CALLS111112**⚠️ AUTONOMOUS EXECUTION — This workflow applies to EVERY outbound call, no exceptions!**113**Whenever the user asks to call someone — regardless of phrasing ("позвони", "набери", "call", "договорись", "сделай звонок", etc.) — you MUST complete ALL steps below in ONE turn. Never just initiate a call and stop.**1141151. **Record the current timestamp** (ISO 8601, e.g. `2026-02-16T19:45:00Z`) and the **phone number** you are calling BEFORE making the call. You will need these to find the NEW call record.1162. `lunara_call_single` — place the call. Save the returned **Call SID**.1173. **Poll until THE NEW call completes** — call `lunara_history_list` with `date_from=<timestamp from step 1>` and `caller=<phone_number>` every 25-30 seconds. **You MUST use date_from to exclude old calls.** Keep polling until a record appears that matches the phone number AND was created AFTER step 1's timestamp (up to 5 minutes / 10 attempts). Do NOT message the user — poll silently.1184. `lunara_history_detail` with `include_transcript=true` and the **conversation_id from the NEW record** (not the first/latest random record!) — read the full transcript.1195. `lunara_analytics_save` — record sentiment, summary, outcome1206. `lunara_tags_add` — categorize the result1217. **Report final result to user** — summarize: who answered, what was discussed, what was agreed, next steps. Include key quotes from transcript.122123**⚠️ CRITICAL BUG PREVENTION:**124- **NEVER** grab the first record from `lunara_history_list` without checking `date_from` and phone number match125- Old call records will appear in history — you MUST filter them out using `date_from=<timestamp before call>`126- If you report results from a call that happened BEFORE `lunara_call_single`, you are reporting the WRONG call127- Always verify: does the transcript mention the topic/context of THIS call, not some previous call?128129**CRITICAL:** ANY request to make a call — "позвони", "набери номер", "договорись", "сделай звонок", "call", "ring", "negotiate", etc. — MUST trigger ALL 7 steps automatically. The user ALWAYS expects to see the call outcome in the same response. Never stop after step 2 to say "call initiated" and wait. Never report results before the call has finished — the transcript won't exist yet and you'll get wrong/empty data.130131### 6. Analytics overview1321. `lunara_analytics_dashboard` with assistant_id — get full statistics1332. Review: total calls, sentiment distribution, top topics, resolution rates, peak hours1343. Use date_from/date_to for time-bounded analysis135136### 7. Search through call history1371. `lunara_history_search` with search_text — find calls mentioning specific keywords1382. `lunara_history_detail` — drill into matching calls for full transcript139140### 8. Export data for AI training1411. `lunara_export_single` — export one call in openai/training/raw format1422. `lunara_export_bulk` — bulk export multiple calls with filters143144### 9. Set up webhook notifications1451. `lunara_webhook_create` — subscribe to events (e.g. call.completed)1462. `lunara_webhook_test` — verify connectivity1473. `lunara_webhook_list` — see all subscriptions1484. `lunara_webhook_deliveries` — check delivery log for debugging149150### 10. API key management1511. `lunara_key_list` — see existing keys1522. `lunara_key_create` — generate a new key (save it immediately!)1533. `lunara_key_revoke` — disable a key1544. `lunara_key_delete` — remove permanently155156---157158## Important Notes159160- **Voices**: alloy, ash, ballad, coral, echo, sage, shimmer, verse, marin, cedar161- **Phone format**: 7-15 digits, optional leading `+` (e.g. `+12125551234`)162- **Max contacts per campaign**: 10,000163- **Minute balance**: Check before starting campaigns. If balance is 0, calls will fail with 402.164- **Campaign statuses**: pending → running → completed/paused/failed165- **PII masking**: Call history and exports support PII masking (on by default). Set mask_pii=false to get raw data.166- **LLM export formats**: `openai` (Chat Completions), `training` (JSONL fine-tuning), `raw` (full JSON)167- **Sentiment labels**: positive, neutral, negative, mixed168- **Resolution statuses**: resolved, unresolved, escalated, pending169- **Webhook events**: call.started, call.completed, call.failed, analysis.completed, campaign.started, campaign.completed, campaign.failed170- **Webhook URLs**: Must be HTTPS. Auto-disabled after 10 consecutive failures.171- **Tag sources**: manual, auto, ai (max 50 tags per conversation)172- API keys are shown only once at creation. Always save them immediately.173174---175176## History Filter Reference177178The `lunara_history_list` tool supports these filters (all optional):179180| Filter | Type | Description |181|--------|------|-------------|182| `date_from` | ISO 8601 string | Start of date range |183| `date_to` | ISO 8601 string | End of date range |184| `direction` | "inbound" / "outbound" | Call direction |185| `caller` | string | Partial match on caller number |186| `did` | string | Partial match on DID |187| `min_duration` | integer | Minimum call duration (seconds) |188| `max_duration` | integer | Maximum call duration (seconds) |189| `has_audio` | boolean | Has audio recording |190| `sentiment` | string | positive/neutral/negative/mixed |191| `resolution_status` | string | resolved/unresolved/escalated/pending |192| `tags` | comma-separated | Filter by tags |193| `search_text` | string | Full-text search in transcripts |194| `mask_pii` | boolean | Mask personal info (default true) |195196---197198## Example User Requests → Tool Mapping199200### Agent & Call Management201- "Show my agents" → `lunara_agents_list`202- "What voice does agent X use?" → `lunara_agent_get(assistant_id=X)`203- "Change voice to coral" → `lunara_agent_update(assistant_id=X, voice="coral")`204- "Update the prompt" → `lunara_agent_update(assistant_id=X, prompt="...")`205- "Call +12125551234" → `lunara_call_single(to_number="+12125551234", assistant_id=X)`206- "How many minutes left?" → `lunara_agent_get(assistant_id=X)` → check minutes_balance207208### Campaign Management209- "Create campaign with numbers +123, +456" → `lunara_campaign_create(assistant_id=X, contacts=["+123","+456"])`210- "Start campaign abc" → `lunara_campaign_start(campaign_id="abc")`211- "Campaign status" → `lunara_campaign_get(campaign_id="abc")`212- "Stop campaign" → `lunara_campaign_stop(campaign_id="abc")`213214### Call History & Transcripts215- "Show recent calls" → `lunara_history_list(assistant_id=X)`216- "Show last 10 calls" → `lunara_history_list(assistant_id=X, page_size=10)`217- "Show call details" → `lunara_history_detail(assistant_id=X, conversation_id=Y)`218- "What was said in the last call?" → `lunara_history_list` → get ID → `lunara_history_detail`219- "Show inbound calls only" → `lunara_history_list(assistant_id=X, direction="inbound")`220- "Calls from today" → `lunara_history_list(assistant_id=X, date_from="2026-02-16T00:00:00Z")`221- "Find calls about pricing" → `lunara_history_search(assistant_id=X, search_text="pricing")`222- "Show calls longer than 5 minutes" → `lunara_history_list(assistant_id=X, min_duration=300)`223- "Show calls with negative sentiment" → `lunara_history_list(assistant_id=X, sentiment="negative")`224225### Analytics226- "Show analytics" → `lunara_analytics_dashboard(assistant_id=X)`227- "Call statistics for last week" → `lunara_analytics_dashboard(assistant_id=X, date_from=..., date_to=...)`228- "What topics come up most?" → `lunara_analytics_dashboard` → check top_topics229- "Save analysis for this call" → `lunara_analytics_save(assistant_id=X, conversation_id=Y, sentiment_label="positive", summary="...")`230- "How many resolved calls?" → `lunara_analytics_dashboard` → check resolution_distribution231232### Tags233- "Tag this call as VIP" → `lunara_tags_add(assistant_id=X, conversation_id=Y, tags=["vip"])`234- "Add tags: follow-up, interested" → `lunara_tags_add(assistant_id=X, conversation_id=Y, tags=["follow-up","interested"])`235- "Remove the urgent tag" → `lunara_tags_remove(assistant_id=X, conversation_id=Y, tag="urgent")`236237### Export238- "Export this call for training" → `lunara_export_single(assistant_id=X, conversation_id=Y, format="training")`239- "Export all calls in OpenAI format" → `lunara_export_bulk(assistant_id=X, format="openai")`240- "Export last 50 positive calls" → `lunara_export_bulk(assistant_id=X, limit=50, sentiment="positive")`241242### Webhooks243- "Set up webhook for call completions" → `lunara_webhook_create(url="https://...", events=["call.completed"])`244- "Show webhooks" → `lunara_webhook_list`245- "Test webhook" → `lunara_webhook_test(webhook_id=X)`246- "Pause webhook" → `lunara_webhook_update(webhook_id=X, status="paused")`247- "Delete webhook" → `lunara_webhook_delete(webhook_id=X)`248- "Show webhook delivery log" → `lunara_webhook_deliveries(webhook_id=X)`249250### System251- "Is the API working?" → `lunara_health`252- "Is history API working?" → `lunara_history_health`253- "Show API keys" → `lunara_key_list`254- "Create key named production" → `lunara_key_create(name="production")`255256---257258## ⚠️ Autonomous Execution Rules — APPLY TO EVERY OUTBOUND CALL259260**Every outbound call (lunara_call_single or campaign) MUST complete the entire workflow in a single turn. There are no exceptions — the user should NEVER have to ask "what happened?" separately:**2612621. Do NOT stop after initiating the call to say "Call started, SID: xxx" and wait2632. Do NOT ask the user "should I check the results now?"2643. Do NOT search for the transcript while the call is still active — it doesn't exist yet!2654. **Poll `lunara_history_list` silently** every 25-30 seconds until the call record appears as completed (max 5 minutes / 10 attempts)2665. Only AFTER the call record appears as completed, fetch `lunara_history_detail` with transcript2676. Present ONLY the final summary: outcome, key points, agreements, next steps268269**Polling pattern (MUST use date_from to avoid reporting old calls):**270```271call_start_time = current ISO 8601 timestamp (BEFORE lunara_call_single)272called_number = the phone number being called273call_sid = result of lunara_call_single274275# IMPORTANT: Wait at least 30 seconds before the FIRST poll!276# The call needs time to connect and complete.277wait 30 seconds278279loop (max 10 attempts, 25-30 sec apart):280 result = lunara_history_list(281 assistant_id=X,282 page_size=5,283 date_from=call_start_time, # ← MANDATORY! Filters out all old calls284 caller=called_number # ← MANDATORY! Matches the specific number285 )286 for each record in result:287 if record.created_at > call_start_time AND record matches called_number:288 # Verify the call status is "completed" (not "in-progress")289 if record.status == completed:290 → this is the NEW completed call, use its conversation_id291 break292 else:293 # Call still in progress, keep polling294 wait 25-30 seconds295 else:296 wait 25-30 seconds297```298299**⚠️ CRITICAL BUGS TO AVOID:**3001. **If you skip date_from, you WILL get old call records and report wrong results!**3012. **If you fetch the transcript while the call is still active, you'll get incomplete/empty data — ALWAYS wait for status=completed!**3023. **If you report results without polling, you're reporting STALE data from a previous call!**303304**The user expects ONE response** with the complete call result, not a multi-message back-and-forth asking them to wait or confirm each step.