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

# search_leads

> Filter leads by status, source, tag, owner or custom field; fetch by id; read saved property searches.

> [!NOTE]
>
> **READ** · 3 operations · never changes data

Filter leads by status, source, tag, owner or custom field; fetch one or many by id; read the property searches a lead has saved.

```js theme={null}
search_leads({ scope?, ids?, filters?, sort?, limit?, cursor?, group_by?, metric?, lead_id? })
```

| Parameter | Notes |
| - | - |
| `ids` | Up to 100. Returns full records and ignores every other parameter. |
| `filters` | Returns a paged summary — `stage`, `source`, `phone`, `email`, `assignedUserId`, `contacted`, `allTags`, `anyTags`, `groupIds`, `key` (free text), and more. |
| `scope` | `"leads"` (default) searches or fetches leads. `"saved_searches"` lists one lead's saved property searches and market snapshots instead — requires `lead_id`, and ignores every other parameter. |
| `lead_id` | With `scope: "saved_searches"`: the lead whose saved searches to list. *Deprecated:* `lead_id` alone, with no `scope` or `ids`, still lists saved searches — pass `scope: "saved_searches"` instead. |

`sort` is an exact, case-sensitive enum name from the real API — not a display label, and not camelCase or a `-`-prefixed field. Common values: `CreateTime` (the default), `LastContact`, `LastActivity`, `AssignTime`, `A2Z`, `Score`. Anything else is rejected.

| Parameter | Notes |
| - | - |
| `group_by` | A field name, e.g. `"stage"`. |
| `metric` | `"count"` (default), `"sum:<field>"`, or `"avg:<field>"`. |

`group_by`/`metric` return grouped counts/sums instead of a record list, rather than paging through everything yourself — it refuses outright past a fixed scan limit rather than ever returning a silently-truncated number.

> [!WARNING]
>
> `cursor` can't be combined with `group_by` — aggregation always scans from the start and has no page to resume from. Drop `cursor` for a `group_by` call.

Notes, manual logs, calls, texts, emails and the activity timeline live in [`search_lead_activities`](https://developer.lofty.com/mcp/tools/search-lead-activities). Lead writes live in [`manage_leads`](https://developer.lofty.com/mcp/tools/manage-leads); saved-search writes in [`create_saved_search`](https://developer.lofty.com/mcp/tools/create-saved-search), [`update_saved_search`](https://developer.lofty.com/mcp/tools/update-saved-search), [`delete_saved_search`](https://developer.lofty.com/mcp/tools/delete-saved-search), [`pause_saved_searches`](https://developer.lofty.com/mcp/tools/pause-saved-searches) and [`resume_saved_searches`](https://developer.lofty.com/mcp/tools/resume-saved-searches).


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