get-audience-content
Analyze audience content engagement by retrieving detailed breakdowns of liked, shared, and influential content including posts, domains, hashtags, and media.
Instructions
Retrieves audience content engagement details for a given audience.
This tool provides a detailed breakdown of the content an audience interacts with, including:
Liked Content: Popular posts, top domains, top emojis, top hashtags, top links, top media, and a word cloud.
Shared Content: Content that the audience shares, categorized similarly to liked content.
Influential Content: Content from influential accounts that impact the audience, with similar categorization.
Each category contains:
popularPost: List of the most engaged posts.
topDomains: Most mentioned domains.
topEmojis: Most used emojis.
topHashtags: Most used hashtags.
topLinks: Most shared links.
topMedia: Media types shared and samples.
wordcloud: Frequently used words.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audience_content_id | Yes | The ID of the audience content to retrieve. |
Implementation Reference
- src/index.ts:259-302 (registration)Registers the 'get-audience-content' MCP tool with description, Zod input schema, and handler function that calls getAudienceContent and formats response.server.tool( "get-audience-content", `Retrieves audience content engagement details for a given audience. This tool provides a detailed breakdown of the content an audience interacts with, including: - **Liked Content**: Popular posts, top domains, top emojis, top hashtags, top links, top media, and a word cloud. - **Shared Content**: Content that the audience shares, categorized similarly to liked content. - **Influential Content**: Content from influential accounts that impact the audience, with similar categorization. Each category contains: - **popularPost**: List of the most engaged posts. - **topDomains**: Most mentioned domains. - **topEmojis**: Most used emojis. - **topHashtags**: Most used hashtags. - **topLinks**: Most shared links. - **topMedia**: Media types shared and samples. - **wordcloud**: Frequently used words.`, { audience_content_id: z.string().describe("The ID of the audience content to retrieve."), }, async ({ audience_content_id }) => { const data = await getAudienceContent(audience_content_id); if (!data) { return { content: [ { type: "text", text: `No content found for audience ${audience_content_id}.`, }, ], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; } );
- src/index.ts:279-301 (handler)MCP handler function for 'get-audience-content' tool that fetches data via getAudienceContent and returns formatted JSON response.async ({ audience_content_id }) => { const data = await getAudienceContent(audience_content_id); if (!data) { return { content: [ { type: "text", text: `No content found for audience ${audience_content_id}.`, }, ], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- src/index.ts:276-278 (schema)Zod input schema defining the required 'audience_content_id' parameter for the tool.{ audience_content_id: z.string().describe("The ID of the audience content to retrieve."), },
- src/audienseClient.ts:237-257 (helper)Helper function implementing the core API call to Audiense for retrieving audience content details using authenticated request.* Retrieves the relevant content that an audience engages with. */ export async function getAudienceContent(audience_content_id: string): Promise<{ createdAt: string; startDate: string; endDate: string; status: string; likedContent: any; sharedContent: any; influentialContent: any; } | null> { return makeAudienseRequest<{ createdAt: string; startDate: string; endDate: string; status: string; likedContent: any; sharedContent: any; influentialContent: any; }>(`/audience_content/${audience_content_id}`); }