Skip to main content
Glama

get_post

Retrieve published Substack posts by ID to access full content including title, body HTML, and metadata for reading or analysis.

Instructions

Get the full content of a published post by ID. Returns title, body HTML, metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYesThe post ID to retrieve

Implementation Reference

  • The getPost method in SubstackClient class executes the core logic for the get_post tool. It makes an HTTP GET request to the Substack API endpoint /api/v1/posts/${id} and returns a SubstackPost object containing the full post content including title, body HTML, metadata, and other details.
    async getPost(id: number): Promise<SubstackPost> {
      return this.request<SubstackPost>(
        `${this.publicationUrl}/api/v1/posts/${id}`,
      );
    }
  • src/server.ts:77-108 (registration)
    Registration of the get_post tool with the MCP server. Defines the tool name, description, input schema (post_id as a number using Zod validation), and the async handler function that calls client.getPost() and formats the response as JSON with post metadata including id, title, subtitle, slug, post_date, audience, word_count, body_html, and canonical_url.
    server.tool(
      "get_post",
      "Get the full content of a published post by ID. Returns title, body HTML, metadata.",
      {
        post_id: z.number().describe("The post ID to retrieve"),
      },
      async ({ post_id }) => {
        const post = await client.getPost(post_id);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  id: post.id,
                  title: post.title,
                  subtitle: post.subtitle,
                  slug: post.slug,
                  post_date: post.post_date,
                  audience: post.audience,
                  word_count: post.word_count,
                  body_html: post.body_html,
                  url: post.canonical_url,
                },
                null,
                2,
              ),
            },
          ],
        };
      },
    );
  • TypeScript interface definition for SubstackPost, which defines the schema/structure of the data returned by the get_post tool. Includes fields: id, title, subtitle, slug, post_date, audience, type, body_html, canonical_url, word_count, description, cover_image, and section_id.
    export interface SubstackPost {
      id: number;
      title: string;
      subtitle: string | null;
      slug: string;
      post_date: string | null;
      audience: string;
      type: string;
      draft_title?: string;
      draft_subtitle?: string;
      draft_body?: string;
      body_html?: string;
      canonical_url: string;
      word_count: number;
      description: string | null;
      cover_image: string | null;
      section_id: number | null;
    }
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. It states the tool retrieves content and returns specific fields, but lacks details on behavioral traits such as error handling (e.g., what happens if the ID is invalid), authentication needs, rate limits, or whether it's read-only. The description covers basic functionality but misses critical operational context.

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 front-loads the core action and resource, followed by return details. Every word contributes value without redundancy, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (single parameter, no output schema, no annotations), the description is adequate but incomplete. It explains what the tool does and returns, but lacks context on errors, permissions, or behavioral nuances. For a read operation, this is minimally viable but leaves gaps in operational guidance.

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%, with the parameter 'post_id' fully documented in the schema. The description adds no additional parameter semantics beyond implying it retrieves by ID, which is already clear from the schema. This meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get'), resource ('full content of a published post'), and scope ('by ID'), distinguishing it from siblings like list_published_posts (which lists) or get_draft (which retrieves drafts). It explicitly mentions what is returned (title, body HTML, metadata), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'published post by ID,' suggesting it's for retrieving individual published posts. However, it does not explicitly state when to use this tool versus alternatives like list_published_posts (for browsing) or get_draft (for unpublished content), nor does it mention prerequisites or exclusions.

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/conorbronsdon/substack-mcp'

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