Skip to main content
Glama

threads_get_user_threads

Retrieve all threads published by a specific user on Threads, with options to filter by date range, limit results, or paginate through content.

Instructions

Get all threads published by the user (alias for threads_get_posts with user context).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results
sinceNoStart date (ISO 8601 or Unix timestamp)
untilNoEnd date (ISO 8601 or Unix timestamp)
afterNoPagination cursor

Implementation Reference

  • The handler for `threads_get_user_threads` is registered directly within the `registerThreadsProfileTools` function in `src/tools/threads/profile.ts`. It includes both the tool definition (schema) and the asynchronous logic to fetch threads from the Meta client.
    // ─── threads_get_user_threads ────────────────────────────────
    server.tool(
      "threads_get_user_threads",
      "Get all threads published by the user (alias for threads_get_posts with user context).",
      {
        limit: z.number().optional().describe("Number of results"),
        since: z.string().optional().describe("Start date (ISO 8601 or Unix timestamp)"),
        until: z.string().optional().describe("End date (ISO 8601 or Unix timestamp)"),
        after: z.string().optional().describe("Pagination cursor"),
      },
      async ({ limit, since, until, after }) => {
        try {
          const params: Record<string, unknown> = {
            fields: "id,media_product_type,media_type,text,permalink,timestamp,shortcode,is_quote_post,topic_tag",
          };
          if (limit) params.limit = limit;
          if (since) params.since = since;
          if (until) params.until = until;
          if (after) params.after = after;
          const { data, rateLimit } = await client.threads("GET", `/${client.threadsUserId}/threads`, params);
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get user threads 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