get_posts
Retrieve newsletter posts from a Beehiiv publication to analyze content performance and track publication activity.
Instructions
Get posts for a publication
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| publication_id | Yes | The ID of the publication | |
| limit | No | Number of posts to return (default: 10) |
Implementation Reference
- server.js:90-92 (handler)Core implementation of get_posts tool: makes HTTP GET request to Beehiiv API to retrieve posts for a publication.async getPosts(publicationId, limit = 10) { return await makeRequest('GET', `${this.baseUrl}/publications/${publicationId}/posts?limit=${limit}`, this.headers); }
- server.js:375-377 (handler)Handler dispatch in tools/call: executes get_posts by calling client.getPosts with parameters.case 'get_posts': result = await client.getPosts(args.publication_id, args.limit || 10); break;
- server.js:218-232 (schema)Input schema for get_posts tool defining publication_id (required) and optional limit.inputSchema: { type: "object", properties: { publication_id: { type: "string", description: "The ID of the publication" }, limit: { type: "number", description: "Number of posts to return (default: 10)", default: 10 } }, required: ["publication_id"] }
- server.js:215-233 (registration)Registration of get_posts tool in tools/list response with name, description, and input schema.{ name: "get_posts", description: "Get posts for a publication", inputSchema: { type: "object", properties: { publication_id: { type: "string", description: "The ID of the publication" }, limit: { type: "number", description: "Number of posts to return (default: 10)", default: 10 } }, required: ["publication_id"] } },