> ## 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.

# notify_agent

> Push an app notification, system SMS or system email to an internal agent, or fire an opportunity alert.

> [!WARNING]
>
> **WRITE** · 4 operations · may change data

Push an app notification, system SMS or system email **to an internal agent**, or fire an opportunity alert.

```js theme={null}
notify_agent({
  channel: "app_push" | "sms" | "email" | "opportunity_alert",
  agent_id, body, task_id, type, subject, lead_id, notification_type, link, confirm_token
})
```

> [!WARNING]
>
> Recipients are always internal agents, never leads.

> [!NOTE]
>
> `agent_id` targets a specific teammate for `channel: "sms"` and `channel: "email"` only — the
> teammate must be on the caller's own team. `app_push` and `opportunity_alert` never accept a
> redirect: `app_push` always notifies the assignee of the given `task_id`, and
> `opportunity_alert` always resolves its recipient from the named `lead_id`. This is by design,
> not a gap — both of those exist to notify the person actually responsible for a task or a lead,
> and letting a caller redirect that to an unrelated third party would defeat the point of the
> channel rather than extend it.

Each channel also needs its own extra parameter:

```js theme={null}
// app_push: task_id and type (TASK or APPOINTMENT) both required, no body, agent_id has no effect.
notify_agent({ channel: "app_push", task_id, type: "TASK" | "APPOINTMENT" })

// sms: body required. agent_id optional - defaults to the caller.
notify_agent({ channel: "sms", body, agent_id })

// email: subject and body required. agent_id optional - defaults to the caller.
notify_agent({ channel: "email", subject, body, agent_id })

// opportunity_alert: lead_id and notification_type both required, body is the alert description,
// link is an optional companion URL, agent_id has no effect.
notify_agent({ channel: "opportunity_alert", lead_id, notification_type, body, link })
```

> [!NOTE]
>
> `notification_type` is the opportunity trigger type — one of a fixed set of integer codes, e.g.
> `11` = viewed a listing, `27` = saved a search, `65` = left a message, `66` = requested a
> showing. See the tool's own `inputSchema` description for the full list; there's no shared enum
> reference across tools for it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.