Skip to main content
Glama
ousepachn

Beehiiv Analytics MCP Server

by ousepachn

get_post_details

Retrieve detailed analytics and statistics for specific newsletter posts from Beehiiv publications to analyze performance metrics and audience engagement.

Instructions

Get detailed information about a specific post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publication_idYesThe ID of the publication
post_idYesThe ID of the post

Implementation Reference

  • Core handler function in BeehiivAPI class that makes the API request to fetch post details, handling optional expand parameters.
    def get_post_details(
        self, publication_id: str, post_id: str, expand: Optional[List[str]] = None
    ) -> Dict[str, Any]:
        """Get detailed information about a specific post."""
        params = {}
        if expand:
            params["expand"] = expand
    
        data = self._make_request(
            "GET", f"/publications/{publication_id}/posts/{post_id}", params
        )
        return data.get("data", {})
  • Input schema definition for the get_post_details tool, specifying required publication_id and post_id, and optional expand array with specific enum values.
    Tool(
        name="get_post_details",
        description="Get detailed information about a specific post",
        inputSchema={
            "type": "object",
            "properties": {
                "publication_id": {
                    "type": "string",
                    "description": "The publication ID",
                },
                "post_id": {
                    "type": "string",
                    "description": "The post ID (e.g., post_00000000-0000-0000-0000-000000000000)",
                },
                "expand": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "enum": [
                            "stats",
                            "free_web_content",
                            "free_email_content",
                            "free_rss_content",
                            "premium_web_content",
                            "premium_email_content",
                        ],
                    },
                    "description": "Additional data to include in response",
                },
            },
            "required": ["publication_id", "post_id"],
        },
    ),
  • Registration and dispatching logic in the call_tool handler that invokes the get_post_details tool when requested.
    elif name == "get_post_details":
        publication_id = arguments["publication_id"]
        post_id = arguments["post_id"]
        expand = arguments.get("expand")
    
        details = client.get_post_details(publication_id, post_id, expand)
        return CallToolResult(
            content=[TextContent(type="text", text=json.dumps(details, indent=2))]
        )
  • server.js:94-96 (handler)
    Alternative JS implementation of the post details handler in BeehiivAPI class, making the API request without expand support.
    async getPostDetails(publicationId, postId) {
      return await makeRequest('GET', `${this.baseUrl}/publications/${publicationId}/posts/${postId}`, this.headers);
    }
  • Input schema for get_post_details in the JS server tools list.
    name: "get_post_details",
    description: "Get detailed information about a specific post",
    inputSchema: {
      type: "object",
      properties: {
        publication_id: {
          type: "string",
          description: "The ID of the publication"
        },
        post_id: {
          type: "string",
          description: "The ID of the post"
        }
      },
      required: ["publication_id", "post_id"]
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), implying it's likely safe and non-destructive, but doesn't confirm this or address other traits like authentication needs, rate limits, error conditions, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 that front-loads the core purpose without unnecessary words. Every part of the sentence ('Get detailed information about a specific post') directly contributes to understanding the tool's function, making it appropriately sized and well-structured.

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

Completeness3/5

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

Given the tool's low complexity (2 required parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks behavioral details, usage guidelines, and output information. Without annotations or an output schema, the agent must rely on the description alone, which is incomplete for safe and effective use.

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?

The schema description coverage is 100%, with clear descriptions for both parameters ('publication_id' and 'post_id'), so the schema does the heavy lifting. The description adds no additional parameter semantics beyond implying these IDs are required to fetch post details, which is already evident from the schema. This meets the baseline for high schema coverage.

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 post'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'get_posts' (which likely lists multiple posts) and 'get_publication_details' (which focuses on publications rather than posts). However, it doesn't specify what 'detailed information' includes, which prevents a perfect score.

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. It doesn't mention prerequisites (e.g., needing a publication ID and post ID), exclusions, or comparisons to siblings like 'get_posts' for listing posts or 'get_publication_details' for publication-level data. This lack of context leaves the agent to infer usage scenarios independently.

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