Skip to main content
Glama

timeline_update_scheduled_event

Modify scheduled social media events by updating details like content, timing, approval status, or platform-specific settings for automated posting workflows.

Instructions

Update an existing scheduled event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdYes
updatesYes

Implementation Reference

  • Handler function that updates the scheduled event in the database. Applies the provided updates to fields like name, prompt, scheduledTime, approved, platform, and metadata. Resets contentGenerated if prompt changes, recalculates generationTime if scheduledTime changes, and ensures scheduledTime is in the future.
    execute: async (params) => { const db = await getDb(); try { const updates: any = { updatedAt: new Date() }; if (params.updates.name) updates.name = params.updates.name; if (params.updates.prompt) { updates.prompt = params.updates.prompt; // Store prompt string directly updates.contentGenerated = false; // Reset generation status if prompt changes } if (params.updates.scheduledTime) { const newScheduledTime = new Date(params.updates.scheduledTime); if (newScheduledTime <= new Date()) { throw new Error('Scheduled time must be in the future'); } updates.scheduledTime = newScheduledTime; updates.generationTime = calculateGenerationTime(newScheduledTime); } if (params.updates.approved !== undefined) updates.approved = params.updates.approved; if (params.updates.platform) updates.platform = params.updates.platform; if (params.updates.metadata) updates.metadata = JSON.stringify(params.updates.metadata); // Convert dates and booleans for SQLite const dbUpdates = prepareEventForDb(updates); await db.update(events) .set(dbUpdates) .where(eq(events.id, params.eventId)); const [updated] = await db.select().from(events).where(eq(events.id, params.eventId)); if (!updated) { return JSON.stringify({ success: false, error: 'Event not found' }, null, 2); } return JSON.stringify({ success: true, event: { id: updated.id, name: updated.name, scheduledTime: updated.scheduledTime, approved: updated.approved, platform: updated.platform } }, null, 2); } catch (error) { if (error instanceof z.ZodError) { return JSON.stringify({ success: false, error: 'Validation error', details: error.errors }, null, 2); } throw error; } } });
  • Zod schema for input parameters: requires eventId (UUID) and an updates object with at least one optional field (name, prompt, scheduledTime, approved, platform, metadata).
    parameters: z.object({ eventId: z.string().uuid(), updates: z.object({ name: z.string().min(1).max(200).optional(), prompt: z.string().min(1).max(5000).optional(), scheduledTime: isoDateTimeSchema.optional(), approved: z.boolean().optional(), platform: platformSchema.optional(), metadata: z.record(z.any()).optional().describe('Platform-specific metadata') }).refine(data => Object.keys(data).length > 0, { message: 'At least one update field must be provided' }) }),
  • Registration of the timeline_update_scheduled_event tool with FastMCP using mcp.addTool, including name, description, parameters schema, and execute handler.
    mcp.addTool({ name: 'timeline_update_scheduled_event', description: 'Update an existing scheduled event',

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/derekalia/timeline-mcp'

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