Skip to main content
Glama

generate_thread

Create multi-post threads for X/Twitter or LinkedIn with numbered posts, transitions, hooks, content posts, and CTAs to distribute content effectively.

Instructions

Generate a multi-post thread for X/Twitter or LinkedIn. Creates numbered posts with transitions, including hook, content posts, and CTA finale.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesThread topic
posts_countNoNumber of posts in the thread (3-10)
platformNoPlatform (linkedin or x)linkedin

Implementation Reference

  • The handler function for the generate_thread tool, which calls the generateThread helper and formats the thread output.
    async ({ topic, posts_count, platform }) => {
      const posts = generateThread(topic, posts_count, platform);
      const limits = PLATFORM_LIMITS[platform];
    
      const output = [
        `=== THREAD ${platform.toUpperCase()} (${posts.length} posts) ===`,
        `Sujet: ${topic}`,
        `Limite par post: ${limits?.maxChars || "?"} caracteres`,
        "",
      ];
    
      posts.forEach((post, i) => {
        output.push(`--- Post ${i + 1}/${posts.length} (${post.length} chars) ---`);
        output.push(post);
        output.push("");
    
        if (post.length > (limits?.maxChars || 3000)) {
          output.push(`ATTENTION: Ce post depasse la limite de ${limits?.maxChars} caracteres !`);
          output.push("");
        }
      });
    
      output.push(`--- Thread total: ${posts.length} posts ---`);
      output.push(`Identite: ${BRAND.identity}`);
    
      return {
        content: [{ type: "text" as const, text: output.join("\n") }],
      };
    },
  • src/index.ts:1064-1077 (registration)
    The registration of the generate_thread tool with its schema, title, description, and input parameters.
    server.registerTool(
      "generate_thread",
      {
        title: "Generate Thread",
        description:
          "Generate a multi-post thread for X/Twitter or LinkedIn. " +
          "Creates numbered posts with transitions, including hook, content posts, and CTA finale.",
        inputSchema: {
          topic: z.string().describe("Thread topic"),
          posts_count: z.number().min(3).max(10).default(5).describe("Number of posts in the thread (3-10)"),
          platform: z.enum(["linkedin", "x"]).default("linkedin").describe("Platform (linkedin or x)"),
        },
        annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false },
      },

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/gomessoaresemmanuel-cpu/content-distribution-mcp'

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