Skip to main content
Glama
ousepachn

Beehiiv Analytics MCP Server

by ousepachn

get_segments

Retrieve audience segments for a specific Beehiiv newsletter publication to analyze subscriber groups and target content effectively.

Instructions

Get segments for a publication

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publication_idYesThe ID of the publication

Implementation Reference

  • Core implementation of the get_segments tool: fetches segments from Beehiiv API endpoint using HTTP GET request.
    async getSegments(publicationId) {
      return await makeRequest('GET', `${this.baseUrl}/publications/${publicationId}/segments`, this.headers);
    }
  • server.js:289-302 (registration)
    Registration of the get_segments tool in the tools/list response, including name, description, and input schema definition.
    {
      name: "get_segments",
      description: "Get segments for a publication",
      inputSchema: {
        type: "object",
        properties: {
          publication_id: {
            type: "string",
            description: "The ID of the publication"
          }
        },
        required: ["publication_id"]
      }
    },
  • Tool dispatch handler in the tools/call case switch that calls the getSegments implementation.
    case 'get_segments':
      result = await client.getSegments(args.publication_id);
      break;
  • Input schema definition for the get_segments tool, specifying the required publication_id parameter.
    inputSchema: {
      type: "object",
      properties: {
        publication_id: {
          type: "string",
          description: "The ID of the publication"
        }
      },
      required: ["publication_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 only states the basic action ('Get segments') without revealing if this is a read-only operation, how results are returned (e.g., pagination, format), error conditions, or rate limits. For a tool with no annotation coverage, this leaves critical behavioral traits unspecified, though it doesn't contradict any annotations.

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 extremely concise with a single, direct sentence that front-loads the core purpose. There is no wasted language or redundancy, making it efficient for quick understanding. However, this conciseness comes at the cost of completeness, as noted in other dimensions.

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 effective tool use. It doesn't explain what 'segments' are in this context, the return format (e.g., list of objects with IDs/names), or behavioral aspects like data freshness or access permissions. For a tool with no structured metadata, the description should provide more context to compensate, but it does not.

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 input schema has 100% description coverage, with the single parameter 'publication_id' clearly documented. The description adds no additional parameter semantics beyond implying the tool fetches segments associated with a publication, which is already inferred from the schema. This meets the baseline score of 3, as the schema adequately covers parameter details without extra value from the description.

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 ('Get') and target resource ('segments for a publication'), making the purpose understandable. It distinguishes from siblings like 'get_segment_details' (which likely retrieves details of a single segment) by implying retrieval of multiple segments. However, it doesn't specify if this returns all segments or filtered ones, leaving some ambiguity compared to siblings.

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 valid publication_id), differentiate from 'get_segment_details' (for single segment details) or 'get_publication_details' (which might include segments), or specify use cases like listing segments for analysis. Without this context, the agent must infer usage from tool names alone.

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