Skip to main content
Glama

threads_get_post_insights

Retrieve analytics for Threads posts including views, likes, replies, reposts, quotes, and clicks to measure post performance.

Instructions

Get insights/analytics for a specific Threads post (views, likes, replies, reposts, quotes, clicks).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
post_idYesThreads post ID
metricNoComma-separated metrics (default: views,likes,replies,reposts,quotes,clicks)

Implementation Reference

  • The handler function for 'threads_get_post_insights', which calls the meta client to fetch insights for a specific post.
    server.tool(
      "threads_get_post_insights",
      "Get insights/analytics for a specific Threads post (views, likes, replies, reposts, quotes, clicks).",
      {
        post_id: z.string().describe("Threads post ID"),
        metric: z.string().optional().describe("Comma-separated metrics (default: views,likes,replies,reposts,quotes,clicks)"),
      },
      async ({ post_id, metric }) => {
        try {
          const m = metric || "views,likes,replies,reposts,quotes,clicks";
          const { data, rateLimit } = await client.threads("GET", `/${post_id}/insights`, { metric: m });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get post insights failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • The registration function 'registerThreadsInsightTools' that adds the tool to the MCP server.
    export function registerThreadsInsightTools(server: McpServer, client: MetaClient): void {

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