Skip to main content
Glama

segments_export

Starts a background job that writes the segment's leads to a file in the workspace Files (workspaces_files_list). Rows, columns and order are the same as the lead table for the given filter + view + status: columns and sort come from the view (default columns when omitted), the filter narrows rows, and ARCHIVED leads are excluded unless status says otherwise. Returns {task_sqid, job_url}; poll jobs_get until COMPLETED, then result.file_sqid is the file to fetch with files_download.

Method: POST /api/v1/workspaces/{workspace_sqid}/segments/{sqid}/export/

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sqid": "<sqid>"
    },
    "name": "segments_export"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqidYes
viewNoViewConfig sqid giving the columns and sort order.
filterNoFilterConfig sqid narrowing the exported rows.
formatNo`xlsx` (Excel, default) or `csv`. * `xlsx` - xlsx * `csv` - csvxlsx
statusNoEmpty = all but ARCHIVED (default), a status value = only that status, `__all__` = every status.
filenameNoFile name; defaults to `YYYY-MM-DD_<segment-name>.<format>`. The extension is forced to match `format`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so: it discloses that the work is asynchronous, names the return payload `{task_sqid, job_url}`, and prescribes the polling loop. It also discloses default row scope (ARCHIVED excluded unless `status` overrides), default columns when `view` is omitted, and that the filename extension is forced to match `format` — all behavior an agent could otherwise get wrong.

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

Conciseness5/5

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

Three tight sentences: what it does and where output goes first, then row/column semantics, then the return value and follow-up chain. Every clause carries operational information, and the trailing HTTP method line is a useful compact anchor rather than filler.

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 no output schema and no annotations, the description must explain the async lifecycle and return shape itself, and it does, including the exact fields to read and the follow-up tool. For a 6-parameter export tool with high schema coverage, nothing essential to correct invocation is missing.

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 description coverage is already 83%, so the baseline is 3; the description adds value by explaining how `view`, `filter`, and `status` combine to determine which rows, columns, and ordering end up in the file. That compositional meaning goes beyond the per-parameter schema text, though several details (filename default, extension forcing) are simply restated from the schema.

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?

The first sentence states a specific verb and resource: it starts a background job that writes a segment's leads to a file in the workspace Files. It also immediately distinguishes this tool's output destination by naming `workspaces_files_list`, so an agent knows this is an export producing a file rather than a list or read of leads.

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?

The description gives an explicit end-to-end usage path: call this to start the job, poll `jobs_get` until COMPLETED, read `result.file_sqid`, then fetch with `files_download`. That is concrete when-to-use and next-step guidance that no sibling name alone would provide.

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.