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',
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is an update operation, implying mutation, but doesn't cover critical aspects like required permissions, whether changes are reversible, rate limits, or what happens to unspecified fields. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words. It's appropriately sized for a basic tool definition and front-loaded with the core action, making it highly efficient in communication.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 2 parameters (including a complex nested object), 0% schema description coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain parameters, behavioral implications, or return values, leaving the agent poorly equipped to use this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description adds no information about the two parameters (eventId and updates) or their nested properties, failing to compensate for the schema's lack of documentation. This leaves parameters entirely unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and resource ('an existing scheduled event'), making the purpose immediately understandable. It distinguishes from siblings like 'timeline_add_scheduled_event' by specifying it's for updates rather than creation, though it doesn't explicitly mention all sibling alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'timeline_remove_scheduled_event' or 'timeline_list_scheduled_events'. The description doesn't mention prerequisites (e.g., needing an existing event ID) or contextual constraints, leaving the agent with minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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