List segments

Segments of the shop from Messaging > Segments, with their Segment Size.

MCP tool postscript_read → list_segments

read

Returns the segments on the Segments page, including the default ones such as All Customers and Subscribers (INTL Included). size is the Segment Size Postscript shows; it refreshes daily for segments used in a campaign in the last 30 days and is otherwise as of the last manual refresh. Unsubscribed people are never counted. Use segment names as include_segments and exclude_segments of create_campaign.

Parameters

Parameters: list_segments
NameTypeDescription
search string string Only segments whose name contains this text.

tools/call

JSON-RPC

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

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "segments": [
      {
        "segment_id": "41872",
        "name": "All Customers and Subscribers (INTL Included)",
        "size": 18240
      },
      {
        "segment_id": "52310",
        "name": "Subscribers with No Orders",
        "size": 5127
      }
    ]
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.