list_segments
Retrieve all contact segments from the Keila newsletter platform to manage and target specific audience groups for email campaigns.
Instructions
List all contact segments.
Returns: A dict with 'data' (list of segments). Each segment has id, name, and filter.
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": "list_segments"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_server.py:220-228 (handler)MCP tool definition for 'list_segments' which wraps the _client.list_segments method.
@mcp.tool() def list_segments() -> dict: """ List all contact segments. Returns: A dict with 'data' (list of segments). Each segment has id, name, and filter. """ return _client.list_segments() - client.py:178-182 (handler)The actual API implementation for listing segments in the client.
def list_segments(self) -> dict: """List all segments.""" resp = self.session.get(f"{self.url}/api/v1/segments", headers=self._headers(), timeout=30) resp.raise_for_status() return resp.json()