analyze_post_performance
Analyze post text to predict engagement scores, assess hook and CTA strength, evaluate readability, and receive improvement suggestions for social media platforms.
Instructions
Analyze a post's text for predicted engagement. Returns estimated engagement score (0-100), hook strength, CTA strength, readability, and actionable improvement suggestions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The post text to analyze | |
| platform | Yes | Target platform |
Implementation Reference
- src/index.ts:1035-1060 (handler)Handler for the analyze_post_performance tool. It calls analyzeEngagement and formats the output.
async ({ text, platform }) => { const analysis = analyzeEngagement(text, platform); const output = [ `=== Analyse Post ${platform.toUpperCase()} ===`, "", `Score engagement estime: ${analysis.score}/100`, "", `Hook: ${analysis.hook_strength.toUpperCase()}`, `CTA: ${analysis.cta_strength.toUpperCase()}`, `Lisibilite: ${analysis.readability.toUpperCase()}`, "", `Longueur: ${text.length}/${PLATFORM_LIMITS[platform]?.maxChars || "?"} caracteres`, "", "--- Suggestions d'amelioration ---", ...analysis.suggestions.map((s) => ` - ${s}`), "", "--- Regles StressZero ---", ...BRAND.tone_rules.map((r) => ` - ${r}`), ].join("\n"); return { content: [{ type: "text" as const, text: output }], }; }, ); - src/index.ts:1021-1034 (registration)Registration of the analyze_post_performance tool.
server.registerTool( "analyze_post_performance", { title: "Analyze Post Performance", description: "Analyze a post's text for predicted engagement. " + "Returns estimated engagement score (0-100), hook strength, CTA strength, " + "readability, and actionable improvement suggestions.", inputSchema: { text: z.string().describe("The post text to analyze"), platform: z.enum(["linkedin", "instagram", "x", "tiktok"]).describe("Target platform"), }, annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false }, },