Goal
Retrieve performance metrics for published posts to identify patterns and make data-driven content recommendations. Analytics agents use this to understand what works and what doesn't.
Which Agents Use This
- analytics — Primary use case for performance analysis and reporting
- content_creator — Check what content types/topics performed best before drafting
- custom — Any agent needing historical performance context
Hard Rules
- MUST only return metrics for published posts (not drafts or scheduled)
- SHOULD calculate engagement_rate consistently: (likes + comments + shares) / impressions
- SHOULD include enough context to identify content patterns (preview, platform, timestamp)
- Require valid account_id that belongs to workspace
Steps
1. Validate input
- Verify account_id exists and belongs to workspace
- Validate date range if provided
- Apply limit (max 100 posts per request)
2. Query posts
- Fetch published posts for account_id within date range
- Filter by platform if specified
- Order by published_at desc
3. Fetch platform metrics
- For each post, query platform API for performance data
- Collect: likes, comments, shares, views, impressions
- Calculate engagement_rate
4. Return structured metrics
- Include post metadata (id, preview, published_at, platform)
- Include raw metrics (likes, comments, shares, views, impressions)
- Include calculated metrics (engagement_rate)
Output
{
"success": true,
"count": 25,
"metrics": [
{
"post_id": "uuid",
"content_preview": "🏠 5 remote work mistakes I made...",
"published_at": "2026-02-15T09:00:00Z",
"platform": "linkedin",
"likes": 47,
"comments": 12,
"shares": 8,
"views": 2340,
"impressions": 8920,
"engagement_rate": 0.0075
}
]
}
Failure Handling
- If account_id not found: return error "Account not found"
- If platform API fails: return cached/stale data with warning
- If no posts found in date range: return empty array with message
Example Usage
Scenario: Analytics agent analyzing recent performance
{
"account_id": "uuid",
"limit": 50,
"date_from": "2026-01-01",
"platform": "linkedin"
}
Result: Receive metrics for last 50 LinkedIn posts since Jan 1 for pattern analysis
1---2name: bolta-get-post-metrics3description: Retrieve performance metrics for published posts including likes, comments, shares, views, and engagement rate4---56## Goal7Retrieve performance metrics for published posts to identify patterns and make data-driven content recommendations. Analytics agents use this to understand what works and what doesn't.89## Which Agents Use This10- **analytics** — Primary use case for performance analysis and reporting11- **content_creator** — Check what content types/topics performed best before drafting12- **custom** — Any agent needing historical performance context1314## Hard Rules151. MUST only return metrics for published posts (not drafts or scheduled)162. SHOULD calculate engagement_rate consistently: (likes + comments + shares) / impressions173. SHOULD include enough context to identify content patterns (preview, platform, timestamp)184. Require valid account_id that belongs to workspace1920## Steps2122### 1. Validate input23- Verify account_id exists and belongs to workspace24- Validate date range if provided25- Apply limit (max 100 posts per request)2627### 2. Query posts28- Fetch published posts for account_id within date range29- Filter by platform if specified30- Order by published_at desc3132### 3. Fetch platform metrics33- For each post, query platform API for performance data34- Collect: likes, comments, shares, views, impressions35- Calculate engagement_rate3637### 4. Return structured metrics38- Include post metadata (id, preview, published_at, platform)39- Include raw metrics (likes, comments, shares, views, impressions)40- Include calculated metrics (engagement_rate)4142## Output43```json44{45 "success": true,46 "count": 25,47 "metrics": [48 {49 "post_id": "uuid",50 "content_preview": "🏠 5 remote work mistakes I made...",51 "published_at": "2026-02-15T09:00:00Z",52 "platform": "linkedin",53 "likes": 47,54 "comments": 12,55 "shares": 8,56 "views": 2340,57 "impressions": 8920,58 "engagement_rate": 0.007559 }60 ]61}62```6364## Failure Handling65- If account_id not found: return error "Account not found"66- If platform API fails: return cached/stale data with warning67- If no posts found in date range: return empty array with message6869## Example Usage7071### Scenario: Analytics agent analyzing recent performance72```json73{74 "account_id": "uuid",75 "limit": 50,76 "date_from": "2026-01-01",77 "platform": "linkedin"78}79```80**Result:** Receive metrics for last 50 LinkedIn posts since Jan 1 for pattern analysis