Skip to main content
Glama

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
NameRequiredDescriptionDefault
compareToAverageNoCompare to account average (default: true)
postIdYesFacebook 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'], }, },
  • 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.'}` }] }; }
  • 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' },

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/wspotter/mcpart'

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