Skip to main content
Glama
ousepachn

Beehiiv Analytics MCP Server

by ousepachn

get_segment_details

Retrieve detailed analytics and statistics for specific audience segments in Beehiiv newsletters to analyze subscriber data and engagement metrics.

Instructions

Get detailed information about a specific segment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publication_idYesThe ID of the publication
segment_idYesThe ID of the segment

Implementation Reference

  • MCP tool handler in the call_tool function that handles the get_segment_details tool invocation by parsing arguments, calling the API client method, and returning the result as MCP content.
    elif name == "get_segment_details":
        publication_id = arguments["publication_id"]
        segment_id = arguments["segment_id"]
        details = client.get_segment_details(publication_id, segment_id)
        return CallToolResult(
            content=[TextContent(type="text", text=json.dumps(details, indent=2))]
        )
  • Core helper function in the BeehiivAPI class that performs the HTTP GET request to the Beehiiv API endpoint for segment details.
    def get_segment_details(
        self, publication_id: str, segment_id: str
    ) -> Dict[str, Any]:
        """Get detailed information about a specific segment."""
        data = self._make_request(
            "GET", f"/publications/{publication_id}/segments/{segment_id}"
        )
        return data.get("data", {})
  • Registration of the get_segment_details tool in the list_tools() function, including name, description, and input schema.
    Tool(
        name="get_segment_details",
        description="Get detailed information about a specific segment",
        inputSchema={
            "type": "object",
            "properties": {
                "publication_id": {
                    "type": "string",
                    "description": "The publication ID",
                },
                "segment_id": {
                    "type": "string",
                    "description": "The segment ID",
                },
            },
            "required": ["publication_id", "segment_id"],
        },
    ),
  • Input schema definition for the get_segment_details tool, specifying required publication_id and segment_id parameters.
    Tool(
        name="get_segment_details",
        description="Get detailed information about a specific segment",
        inputSchema={
            "type": "object",
            "properties": {
                "publication_id": {
                    "type": "string",
                    "description": "The publication ID",
                },
                "segment_id": {
                    "type": "string",
                    "description": "The segment ID",
                },
            },
            "required": ["publication_id", "segment_id"],
        },
    ),
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get'), but doesn't mention authentication requirements, rate limits, error conditions, response format, or whether it returns nested data. For a tool with two required parameters and no output schema, this leaves significant behavioral gaps.

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?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the core purpose immediately. Every word earns its place in conveying the essential function.

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

Completeness2/5

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

For a retrieval tool with two required parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'detailed information' includes, how the segment relates to the publication, what format the response takes, or potential error scenarios. The agent would need to guess about the tool's behavior and output structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters clearly documented in the schema. The description adds no additional parameter context beyond implying these IDs are needed to fetch segment details. This meets the baseline of 3 when the schema does the heavy lifting, though the description doesn't enhance understanding of what constitutes valid IDs or their relationships.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'detailed information about a specific segment', which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_segments' (which likely lists segments) or 'get_publication_details' (which focuses on publications rather than segments).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_segments' (for listing segments) or 'get_post_details' (for post-level details). It doesn't mention prerequisites, exclusions, or contextual factors that would help an agent choose between these similar retrieval tools.

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/ousepachn/beehiivanalyticsMCP'

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