Skip to main content
Glama

leadmarina

Export leads to a destination

export_leads

Push leads into a connected destination: 'close' (CRM — uses the account's saved field mapping), 'ghl' (GoHighLevel sub-account), 'google_sheets' (new spreadsheet, or pass spreadsheet_id for one LeadMarina created before), or a file — 'csv' | 'xlsx' | 'json' (a 7-day download link, also emailed to the account owner when the file is small enough to attach). Exports EITHER one search's leads (pass search_id) or the whole library (set all=true). Either can be narrowed with the same filter rows as query_leads — with search_id they apply within that search. Leads go out best-ranked first (rank, then id), the order of the leads table. LIMITS PER CALL, which differ by destination because CRMs take one API call per lead: csv/xlsx 50,000 · json 25,000 · google_sheets 5,000 · close/ghl 1,000. For a big library going to a CRM, export csv and import the file instead. If more leads match than the limit, the response sets truncated=true and returns next_cursor — relay that to the user, the export was partial; to send the next batch, call export_leads again with the SAME destination, search_id or all, and filters, plus cursor=next_cursor. A next_cursor with not_sent means the destination's time limit cut this batch short: the same call with that cursor sends the rest. An all=true export spread over several calls reads the library live, so a lead that a search running between calls finds again can be skipped or sent twice; for one consistent copy, export the library in a single csv/xlsx (up to 50,000 leads) or json (up to 25,000) call while no search is running. Close, GoHighLevel and a LeadMarina-created sheet passed as spreadsheet_id UPDATE previously exported leads in place (matched by Google CID), never touching the user's own CRM notes/columns; a file or a new sheet is a fresh copy every time — so do not repeat a call that succeeded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoExport the whole library instead of one search.
cursorNoContinue an export: the next_cursor a previous export_leads call returned. Pass it with the same search_id/all and filters.
filtersNoOptional query_leads-style filter rows: within the search when search_id is given, across the library with all=true.
search_idNoExport this search's leads.
destinationYesWhere the leads go.
spreadsheet_idNogoogle_sheets only: add to this existing LeadMarina-created sheet instead of a new one.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoFile exports only: the file name.
noteNo
limitNoThe per-call limit that applied, when truncated.
outcomeYesHuman-readable result, e.g. added/updated counts.
warningNoPresent when the per-call limit or this call's time limit left leads unsent: what happened and how to send them. Leads the destination refused are not covered here — outcome counts them as failed.
exportedYesLeads sent to the destination.
not_sentNoLeads of this batch the destination's time limit did not reach.
truncatedNoTrue when more leads matched than this destination's limit — the export was PARTIAL.
next_cursorNoPresent when the per-call limit or this call's time limit left matching leads unsent: pass it as cursor, with the same destination, search_id/all and filters, to send them. It does not offer again a lead the destination refused (counted as failed in outcome).
data_sourcesNoWhere the sources, licences and notices are for emails and owner names that may come from open datasets and public records. Pass it on with any of this data you share.
download_urlNoFile exports only: 7-day download link.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / data_sources
      Added value: +{
      +  "description": "Where the sources, licences and notices are for emails and owner names that may come from open datasets and public records. Pass it on with any of this data you share.",
      +  "type": "string"
      +}
  2. Changed5 schema fields changed
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Continue an export: the next_cursor a previous export_leads call returned. Pass it with the same search_id/all and filters.",
      +  "type": "string"
      +}
    • changedInput schema / properties / filters / description
      Previous value: -"With all=true: narrow the library using query_leads-style filter rows."New value: +"Optional query_leads-style filter rows: within the search when search_id is given, across the library with all=true."
    • addedOutput schema / properties / next_cursor
      Added value: +{
      +  "description": "Present when the per-call limit or this call's time limit left matching leads unsent: pass it as cursor, with the same destination, search_id/all and filters, to send them. It does not offer again a lead the destination refused (counted as failed in outcome).",
      +  "type": "string"
      +}
    • addedOutput schema / properties / not_sent
      Added value: +{
      +  "description": "Leads of this batch the destination's time limit did not reach.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / warning / description
      Previous value: -"Present when truncated: what happened and how to get the rest."New value: +"Present when the per-call limit or this call's time limit left leads unsent: what happened and how to send them. Leads the destination refused are not covered here — outcome counts them as failed."
  3. Changed4 schema fields changed
    • changedInput schema / properties / all / description
      Previous value: -"Export the whole library instead. Exports write a file, so there is no row cap."New value: +"Export the whole library instead of one search."
    • addedOutput schema / properties / limit
      Added value: +{
      +  "description": "The per-call limit that applied, when truncated.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when more leads matched than this destination's limit — the export was PARTIAL.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / warning
      Added value: +{
      +  "description": "Present when truncated: what happened and how to get the rest.",
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / all / description
      Previous value: -"Export the whole library instead (max 1000 leads)."New value: +"Export the whole library instead. Exports write a file, so there is no row cap."
  5. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources