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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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()
Behavior4/5

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

With no annotations provided, the description carries full behavioral burden. It discloses the non-cascading nature (contacts preserved) and specifies the return value (Confirmation message), though it omits permission requirements or idempotency details.

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?

Extremely efficient Args/Returns docstring structure. Main action is front-loaded, zero redundant text, and the structured parameter documentation adds value without verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Appropriately complete for a single-parameter deletion tool. Covers operation scope, parameter format, and return value. Could be elevated to 5 with brief mention of error conditions or idempotency behavior.

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?

Excellent compensation for 0% schema description coverage. Adds semantic meaning via the Args block, specifically providing the ID format example 'sgm_12345' which is absent from the schema's title-only parameter definition.

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?

States specific verb (Delete) + resource (segment). The clarification 'Does not delete the contacts in it' effectively distinguishes this from sibling delete_contact and defines scope boundaries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides implicit safety guidance by clarifying that contacts remain after deletion, but lacks explicit when-to-use guidance or comparison to update_segment/list_segments siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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