get_content_calendar
View scheduled content for upcoming days to manage distribution timelines and plan content strategy effectively.
Instructions
View the content calendar/queue. Shows all scheduled content for the next N days.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days_ahead | No | Number of days to look ahead (1-30) |
Implementation Reference
- src/index.ts:950-1000 (handler)The handler function for get_content_calendar, which reads the queue and returns upcoming content scheduled within a specified range.
async ({ days_ahead }) => { const queue = readQueue(); const today = new Date(); const cutoff = new Date(today); cutoff.setDate(cutoff.getDate() + days_ahead); const todayStr = today.toISOString().split("T")[0]; const cutoffStr = cutoff.toISOString().split("T")[0]; const upcoming = queue .filter((item) => { return item.scheduled_date >= todayStr! && item.scheduled_date <= cutoffStr!; }) .sort((a, b) => { const dateCompare = a.scheduled_date.localeCompare(b.scheduled_date); if (dateCompare !== 0) return dateCompare; return a.scheduled_time.localeCompare(b.scheduled_time); }); if (upcoming.length === 0) { return { content: [{ type: "text" as const, text: `Aucun contenu planifie pour les ${days_ahead} prochains jours.\n\nUtilise schedule_content pour ajouter du contenu a la file.`, }], }; } const lines = [ `=== Calendrier Contenu (${todayStr} → ${cutoffStr}) ===`, `${upcoming.length} posts planifies`, "", ]; // Group by date const byDate: Record<string, QueueItem[]> = {}; upcoming.forEach((item) => { if (!byDate[item.scheduled_date]) byDate[item.scheduled_date] = []; byDate[item.scheduled_date].push(item); }); Object.entries(byDate).forEach(([date, items]) => { lines.push(`--- ${date} ---`); items.forEach((item) => { const preview = item.content.substring(0, 80).replace(/\n/g, " "); lines.push(` [${item.scheduled_time}] ${item.platform.toUpperCase()} | ${item.status} | ${preview}...`); lines.push(` ID: ${item.id}`); }); lines.push(""); }); - src/index.ts:939-949 (registration)The tool registration for get_content_calendar, including its schema definition.
server.registerTool( "get_content_calendar", { title: "Get Content Calendar", description: "View the content calendar/queue. Shows all scheduled content for the next N days.", inputSchema: { days_ahead: z.number().min(1).max(30).default(7).describe("Number of days to look ahead (1-30)"), }, annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false }, },