Skip to main content
Glama
ousepachn

Beehiiv Analytics MCP Server

by ousepachn

get_publication_details

Retrieve detailed analytics and statistics for a specific Beehiiv newsletter publication using its ID.

Instructions

Get detailed information about a specific publication

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publication_idYesThe ID of the publication

Implementation Reference

  • MCP call_tool handler that processes arguments, calls the Beehiiv API client, and returns the publication details as JSON text content.
    elif name == "get_publication_details":
        publication_id = arguments["publication_id"]
        details = client.get_publication_details(publication_id)
        return CallToolResult(
            content=[TextContent(type="text", text=json.dumps(details, indent=2))]
        )
  • Input schema specifying the required 'publication_id' string parameter for the tool.
    inputSchema={
        "type": "object",
        "properties": {
            "publication_id": {
                "type": "string",
                "description": "The publication ID (e.g., pub_00000000-0000-0000-0000-000000000000)",
            }
        },
        "required": ["publication_id"],
    },
  • Tool registration in the list_tools() decorator, including name, description, and schema.
    Tool(
        name="get_publication_details",
        description="Get detailed information about a specific publication",
        inputSchema={
            "type": "object",
            "properties": {
                "publication_id": {
                    "type": "string",
                    "description": "The publication ID (e.g., pub_00000000-0000-0000-0000-000000000000)",
                }
            },
            "required": ["publication_id"],
        },
    ),
  • BeehiivAPI helper method that performs the actual API request to fetch publication details.
    def get_publication_details(self, publication_id: str) -> Dict[str, Any]:
        """Get detailed information about a specific publication."""
        data = self._make_request("GET", f"/publications/{publication_id}")
        return data.get("data", {})

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