Skip to main content
Glama

export_leads_file

Destructive

Export EVERY lead matching a filter to a downloadable file and return { url, filename, format, count, bytes, truncated }. url is a signed link (valid 7 days) to a private file. Unlike export_leads (which pages 100 at a time), this pulls the whole filtered set server-side into one file. format: csv (default; flat lead columns + account_name + memory_count/documents_count, for spreadsheets) | json | jsonl (both full-fidelity: all columns + ai_memory[] + documents[] + nested contact/account). Same filters as list_leads. max_rows caps the export (default 5000, max 20000); truncated=true means the cap was hit — narrow the filter or raise max_rows for the rest.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "export_leads_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
customNoFilter on lead custom fields (list_custom_fields entity 'leads'): { key: value } — value = equals (multiselect: contains), array = any of (multiselect: contains all), null = empty. E.g. { "stufe": "A", "marken": ["KTM"] }.
formatNocsv (default) | json | jsonl
searchNoFree-text search term
statusNoOnly entries with this status
categoryNoExact category match (case-insensitive)
max_rowsNoCap total exported rows (default 5000, max 20000)
owner_idNoID of the owner (user)
min_scoreNoOnly export leads with at least this score (0-100)
stale_daysNoOnly leads whose last activity is older than N days
campaign_idNoID of the campaign
no_campaignNoOnly leads not assigned to any campaign
include_accountNoNest the lead's account in json/jsonl (default true)
include_contactNoNest the lead's contact in json/jsonl (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / campaign_id / description
      Added value: +"ID of the campaign"
    • addedInput schema / properties / min_score / description
      Added value: +"Only export leads with at least this score (0-100)"
    • addedInput schema / properties / owner_id / description
      Added value: +"ID of the owner (user)"
    • addedInput schema / properties / search / description
      Added value: +"Free-text search term"
    • addedInput schema / properties / status / description
      Added value: +"Only entries with this status"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations flag destructiveHint=true and readOnlyHint=false, and the description explains the practical consequence: a private file plus a signed link valid 7 days, with truncation signalled by truncated=true and caps of 5000 default / 20000 max. That is substantial behavioral context beyond the annotations, though it never explains why the call is destructive (e.g. whether it overwrites or accumulates stored files) — a gap on the exact axis the annotation raises.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and return shape, then the sibling contrast, then format and cap semantics — a logical order with no filler. It is dense to the point of requiring careful reading, and the format enumeration is a long inline clause, but nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 13 parameters, nested custom-filter objects, and no output schema, the description carries the load well: it documents the return object field-by-field, the url lifetime, the format trade-offs, and truncation behavior. An agent can build a correct call and correctly interpret a truncated result from this alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3; the description earns more by giving format selection semantics the schema lacks (csv = flat lead columns + account_name + memory_count/documents_count for spreadsheets; json/jsonl = full fidelity with ai_memory[], documents[], nested contact/account) and by tying max_rows to the truncated flag. It does not add meaning for the filter parameters (custom, stale_days, no_campaign), relying on the schema there.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ('Export EVERY lead matching a filter to a downloadable file') plus the exact return shape, and explicitly differentiates itself from the sibling export_leads ('which pages 100 at a time'). An agent can choose between the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names the alternative (export_leads), explains the decisive condition (paged 100 at a time vs. whole filtered set in one file), and tells the agent what to do when output is incomplete ('narrow the filter or raise max_rows'). It also anchors filter semantics to list_leads, which removes ambiguity about how to build a query.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.