Skip to main content
Glama

threads_get_replies

Retrieve conversation replies for a Threads post using the post ID to view and manage discussion threads.

Instructions

Get replies (conversation) for a specific Threads post.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYesThreads post ID to get replies for
reverseNoReverse chronological order
limitNoNumber of replies
afterNoPagination cursor

Implementation Reference

  • The handler logic for 'threads_get_replies' tool.
    async ({ post_id, reverse, limit, after }) => {
      try {
        const params: Record<string, unknown> = {
          fields: "id,text,username,permalink,timestamp,media_type,media_url,has_replies,hide_status,is_verified,profile_picture_url",
        };
        if (reverse !== undefined) params.reverse = reverse;
        if (limit) params.limit = limit;
        if (after) params.after = after;
        const { data, rateLimit } = await client.threads("GET", `/${post_id}/replies`, params);
        return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
      } catch (error) {
        return { content: [{ type: "text", text: `Get replies failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
      }
    }
  • Tool registration for 'threads_get_replies'.
    server.tool(
      "threads_get_replies",
      "Get replies (conversation) for a specific Threads post.",
      {
        post_id: z.string().describe("Threads post ID to get replies for"),
        reverse: z.boolean().optional().describe("Reverse chronological order"),
        limit: z.number().optional().describe("Number of replies"),
        after: z.string().optional().describe("Pagination cursor"),
      },
      async ({ post_id, reverse, limit, after }) => {
        try {
          const params: Record<string, unknown> = {
            fields: "id,text,username,permalink,timestamp,media_type,media_url,has_replies,hide_status,is_verified,profile_picture_url",
          };
          if (reverse !== undefined) params.reverse = reverse;
          if (limit) params.limit = limit;
          if (after) params.after = after;
          const { data, rateLimit } = await client.threads("GET", `/${post_id}/replies`, params);
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get replies failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );

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/mikusnuz/meta-mcp'

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