get analytics child content published
Retrieve daily comment counts for TabNews content to analyze engagement and track discussion activity over time.
Instructions
To get how many comments were made (per day) in tabnews
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/status.ts:253-278 (handler)MCP tool handler that invokes the analytics service and formats the response as JSON text content.handler: async (): Promise<McpResponse> => { try { const result = await getAnalyticsChildContentPublished(); const content: McpTextContent = { type: "text", text: `Analytics Child Content Published:\n\n${JSON.stringify( result, null, 2 )}`, }; return { content: [content], }; } catch (error) { if (error instanceof Error) { throw new Error( `Failed to get analytics child content published: ${error.message}` ); } else { throw new Error("Failed to get analytics child content published"); } } },
- src/index.ts:73-78 (registration)Registration of the tool in the MCP server using server.tool().server.tool( getAnalyticsChildContentPublishedTool.name, getAnalyticsChildContentPublishedTool.description, getAnalyticsChildContentPublishedTool.parameters, getAnalyticsChildContentPublishedTool.handler );
- src/services/api.ts:103-112 (helper)API service helper that fetches child content published analytics data from TabNews API endpoint.export async function getAnalyticsChildContentPublished(): Promise< AnalyticsChildContentPublished[] > { const response = await fetch( `${TABNEWS_API_URL}/analytics/child-content-published` ); const data = await response.json(); return data as AnalyticsChildContentPublished[]; }
- src/types/index.ts:130-133 (schema)TypeScript interface defining the structure of the analytics child content published data (output schema).export interface AnalyticsChildContentPublished { date: string; respostas: number; }
- src/tools/status.ts:252-252 (schema)Input parameters schema using Zod (empty object, no parameters required).parameters: {},