> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lofty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# generate_lead_insight

> Produce a call script, a prepare-insight, a call summary, or queue a lead analysis.

<Warning>**WRITE** · 4 operations · may change data</Warning>

Produce a call script, a prepare-insight, a call summary, or queue a lead analysis. Generating is a write — reading a cached result is [`search_lead_insights`](/mcp/tools/search-lead-insights).

Each `kind` needs its own id — there is no single shared `lead_id` shape:

```js theme={null}
// kind=call_script: lead_id and task_id are both required.
generate_lead_insight({ kind: "call_script", lead_id, task_id })

// kind=insight: lead_id and appointment_id are both required.
generate_lead_insight({ kind: "insight", lead_id, appointment_id })

// kind=call_summary: lead_id and call_record_id are both required.
generate_lead_insight({ kind: "call_summary", lead_id, call_record_id })

// kind=analysis: lead_ids (up to 10), not lead_id.
generate_lead_insight({ kind: "analysis", lead_ids: [lead_id, ...] })
```
