Skip to main content
Glama

get_analytics

Retrieve detailed analytics for a specific email draft in Buttondown by providing the draft ID. Supports email performance tracking and data-driven decisions.

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 asynchronous handler function for the 'get_analytics' tool. It ensures the API key is set, fetches analytics using the API client, and returns the response as formatted JSON text.
    async ({ draftId }) => { await this.ensureApiKey(); const response = await this.api.getAnalytics(draftId); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
  • Zod schema for the input parameters of the 'get_analytics' tool, requiring a 'draftId' string.
    { draftId: z .string() .describe("The ID of the email draft to get analytics for"), },
  • Registration of the 'get_analytics' MCP tool on the server, including name, description, input schema, and handler function.
    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), }, ], }; } );
  • The ButtondownAPI client's getAnalytics method that makes the HTTP request to retrieve analytics for a given email ID.
    async getAnalytics(emailId: string): Promise<ButtondownAnalytics> { return this.request<ButtondownAnalytics>(`/emails/${emailId}/analytics`); }

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

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