Skip to main content
Glama

delete_segment

Remove a contact segment from the Keila newsletter system while preserving the contacts within it. Specify the segment ID to delete the grouping without affecting individual contact records.

Instructions

Delete a segment. Does not delete the contacts in it.

Args: segment_id: The segment ID (e.g. "sgm_12345").

Returns: Confirmation message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
segment_idYes

Implementation Reference

  • Tool registration and handler function for deleting a segment in MCP server.
    @mcp.tool()
    def delete_segment(segment_id: str) -> str:
        """
        Delete a segment. Does not delete the contacts in it.
    
        Args:
            segment_id: The segment ID (e.g. "sgm_12345").
    
        Returns:
            Confirmation message.
        """
        _client.delete_segment(segment_id)
        return f"Segment {segment_id} deleted."
  • API client method that performs the actual HTTP DELETE request to delete a segment.
    def delete_segment(self, segment_id: str) -> None:
        """Delete a segment."""
        resp = self.session.delete(f"{self.url}/api/v1/segments/{segment_id}", headers=self._headers(), timeout=30)
        resp.raise_for_status()

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