Skip to main content
Glama

list_publications

Retrieve all accessible publications using the API key to manage or analyze content within the Beehiiv platform.

Instructions

List all publications accessible with this API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_publications' tool, decorated with @mcp.tool() for registration. It fetches and formats the list of publications from the Beehiiv API.
    @mcp.tool()
    async def list_publications() -> str:
        """
        List all publications accessible with this API key.
        """
        data = await beehiiv_request("GET", "/publications")
        if not data or "data" not in data:
            return "Failed to fetch publications."
        pubs = data["data"]
        return "\n".join(f"{p['id']}: {p['name']}" for p in pubs)
  • Supporting helper utility 'beehiiv_request' used by the list_publications handler to perform authenticated HTTP requests to the Beehiiv API.
    async def beehiiv_request(
        method: str,
        path: str,
        params: Optional[dict[str, Any]] = None,
        json_body: Optional[dict[str, Any]] = None
    ) -> Optional[dict[str, Any]]:
        """
        Helper to call the beehiiv API v2.
    
        Args:
            method: HTTP method (GET, POST, etc.)
            path:   API path (e.g. '/publications')
            params: Query parameters
            json_body: Request JSON body
        """
        headers = {
            "Authorization": f"Bearer {BEEHIIV_API_KEY}",
            "Content-Type": "application/json"
        }
        url = f"{BASE_URL}{path}"
        async with httpx.AsyncClient() as client:
            try:
                response = await client.request(
                    method, url,
                    headers=headers,
                    params=params,
                    json=json_body,
                    timeout=30.0
                )
                response.raise_for_status()
                return response.json()
            except httpx.HTTPError as e:
                return {"error": str(e)}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation by using 'List', but fails to detail important traits such as pagination, rate limits, error handling, or the format of returned data. This leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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, clear sentence that directly states the tool's purpose without any unnecessary words or structural fluff. It is front-loaded and efficiently communicates the core functionality, making it easy to parse and understand quickly.

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?

Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns a list of publications. It does not cover the return format, potential limitations (e.g., max results), or error conditions. For a listing tool with no structured support, more context is needed to fully guide usage.

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?

The input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description does not add parameter details, which is acceptable here as there are no parameters to explain. It appropriately avoids redundancy, earning a baseline score for tools with zero parameters.

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 action ('List') and resource ('publications'), specifying that it retrieves all publications accessible with the API key. However, it does not distinguish this tool from sibling tools like 'list_posts', which might serve a similar listing function for different resources, leaving some ambiguity about differentiation.

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 minimal guidance, stating it lists publications accessible with the API key, but offers no explicit advice on when to use this tool versus alternatives like 'list_posts'. There is no mention of prerequisites, exclusions, or specific contexts for usage, limiting its helpfulness for decision-making.

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

Related 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/reymerekar7/beehiiv-mcp-server'

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