Skip to main content
Glama
The-Focus-AI

Buttondown MCP Server

by The-Focus-AI

get_analytics

Retrieve analytics data for a specific email draft from Buttondown to track performance metrics and engagement insights.

Instructions

Retrieve analytics data for a specific email draft from Buttondown

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
draftIdYesThe ID of the email draft to get analytics for

Implementation Reference

  • The handler function for the 'get_analytics' MCP tool. It ensures the API key is set, retrieves analytics data for the given draft ID using the ButtondownAPI client, and returns the JSON-stringified response wrapped in MCP content format.
    async ({ draftId }) => {
      await this.ensureApiKey();
      const response = await this.api.getAnalytics(draftId);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
  • Zod schema defining the input parameters for the 'get_analytics' tool: a required string draftId.
    {
      draftId: z
        .string()
        .describe("The ID of the email draft to get analytics for"),
    },
  • Registration of the 'get_analytics' tool on the MCP server, including name, description, input schema, and handler.
    this.server.tool(
      "get_analytics",
      "Retrieve analytics data for a specific email draft from Buttondown",
      {
        draftId: z
          .string()
          .describe("The ID of the email draft to get analytics for"),
      },
      async ({ draftId }) => {
        await this.ensureApiKey();
        const response = await this.api.getAnalytics(draftId);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
      }
    );
  • API client helper method that fetches analytics data via HTTP GET to Buttondown's /emails/{emailId}/analytics endpoint.
    async getAnalytics(emailId: string): Promise<ButtondownAnalytics> {
      return this.request<ButtondownAnalytics>(`/emails/${emailId}/analytics`);
    }
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 states 'Retrieve analytics data' which implies a read-only operation, but doesn't specify what analytics are included (e.g., open rates, clicks), permissions required, rate limits, or response format. This is a significant gap for a tool with no annotation coverage.

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 directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what analytics data is returned, potential errors, or behavioral traits. For a tool that retrieves data, this leaves critical gaps in understanding how to use it effectively.

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%, so the schema already documents the single parameter 'draftId' fully. The description adds no additional meaning beyond implying the parameter is for a specific email draft, which is redundant with the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Retrieve analytics data') and target resource ('for a specific email draft from Buttondown'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'list_emails' or 'schedule_draft', which might also involve analytics or draft operations, so it misses full sibling distinction.

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 draft ID), exclusions, or how it differs from sibling tools like 'list_emails' that might list drafts. This leaves usage context unclear.

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/The-Focus-AI/buttondown-mcp'

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