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
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Thread topic | |
| posts_count | No | Number of posts in the thread (3-10) | |
| platform | No | Platform (linkedin or x) |
Implementation Reference
- src/index.ts:1078-1106 (handler)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 }, },