Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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()
  • 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()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gwbischof/keila-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server