analyze_post_performance
Analyze individual social media post performance to identify which content resonates best with your audience and compare results to account averages.
Instructions
Analyze individual post performance with insights on what content performs best.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| compareToAverage | No | Compare to account average (default: true) | |
| postId | Yes | Facebook or Instagram post ID |
Implementation Reference
- src/index.ts:475-486 (registration)Registration of the 'analyze_post_performance' tool including name, description, and input schema definition.{ name: 'analyze_post_performance', description: 'Analyze individual post performance with insights on what content performs best.', inputSchema: { type: 'object', properties: { postId: { type: 'string', description: 'Facebook or Instagram post ID' }, compareToAverage: { type: 'boolean', description: 'Compare to account average (default: true)' }, }, required: ['postId'], }, },
- src/index.ts:1408-1445 (handler)Handler implementation for 'analyze_post_performance' tool. Validates input, generates mock performance metrics for the given post ID, compares to account average if requested, and returns formatted analysis insights.case 'analyze_post_performance': { const postId = String(args?.postId || ''); const compareToAverage = Boolean(args?.compareToAverage ?? true); if (!postId) { return { content: [{ type: 'text', text: `โ Please provide a post ID to analyze.` }] }; } // Mock analysis (real implementation would call Meta Graph API) const mockAnalysis = { postId, reach: 2340, impressions: 3120, engagement: 187, likes: 156, comments: 23, shares: 8, engagementRate: 8.0, accountAverage: { reach: 1850, engagementRate: 5.5 } }; const performance = mockAnalysis.engagementRate > mockAnalysis.accountAverage.engagementRate ? '๐ Above' : '๐ Below'; return { content: [{ type: 'text', text: `๐ Post Performance Analysis\n๐ Post ID: ${postId}\n\n๐ Metrics:\n ๐ฅ Reach: ${mockAnalysis.reach.toLocaleString()}\n ๐๏ธ Impressions: ${mockAnalysis.impressions.toLocaleString()}\n ๐ฌ Engagement: ${mockAnalysis.engagement} (${mockAnalysis.engagementRate}%)\n โค๏ธ Likes: ${mockAnalysis.likes}\n ๐ฌ Comments: ${mockAnalysis.comments}\n ๐ Shares: ${mockAnalysis.shares}\n\n${compareToAverage ? `๐ vs Account Average:\n ${performance} average (${mockAnalysis.engagementRate}% vs ${mockAnalysis.accountAverage.engagementRate}%)\n Reach ${mockAnalysis.reach > mockAnalysis.accountAverage.reach ? '+' : ''}${((mockAnalysis.reach / mockAnalysis.accountAverage.reach - 1) * 100).toFixed(1)}%\n\n` : ''}๐ก Insight: ${mockAnalysis.engagementRate > 7 ? 'Great post! Create more content like this.' : 'Try experimenting with different content types or posting times.'}` }] }; }
- src/index.ts:478-484 (schema)Input schema definition for the 'analyze_post_performance' tool, specifying postId as required string and optional compareToAverage boolean.inputSchema: { type: 'object', properties: { postId: { type: 'string', description: 'Facebook or Instagram post ID' }, compareToAverage: { type: 'boolean', description: 'Compare to account average (default: true)' }, }, required: ['postId'],
- src/dashboard.ts:82-82 (registration)Mock registration of the tool in the dashboard for display purposes.{ name: 'analyze_post_performance', description: 'Analyze individual posts', category: 'Social Media Management' },