Skip to main content
Glama

update_document_lifecycle

Update and manage document lifecycle states (e.g., draft, review, approved) in CastPlan MCP. Includes optional review scheduling and comments for improved workflow tracking.

Instructions

Update the lifecycle state of a document with optional review scheduling

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdYesUUID of the document
newStateYesNew lifecycle state
reviewCommentNoOptional review comment
scheduledReviewNoISO datetime for scheduled review

Implementation Reference

  • The handler function that implements the core logic for updating a document's lifecycle state, including state transition and optional review scheduling via DocumentLifecycleService.
    tools.set('update_document_lifecycle', async (args: any) => { try { logger.info(`Updating document ${args.documentId} to state: ${args.newState}`); // Update document state await lifecycleService.updateDocumentState(args.documentId, args.newState); // Schedule review if provided if (args.scheduledReview) { await lifecycleService.scheduleReview(args.documentId, args.scheduledReview); } // Get updated document for confirmation const document = await lifecycleService.getDocumentById(args.documentId); return { success: true, document: document?.title || 'Unknown', newState: args.newState, reviewComment: args.reviewComment, scheduledReview: args.scheduledReview ? localizationService.formatDateTime(new Date(args.scheduledReview)) : null, updatedAt: localizationService.getCurrentDateTimeString() }; } catch (error) { logger.error('Failed to update document lifecycle:', error); throw error; } });
  • Zod schema defining the input validation for the update_document_lifecycle tool parameters.
    export const UpdateDocumentLifecycleSchema = z.object({ documentId: z.string().uuid(), newState: z.nativeEnum(DocumentLifecycleState), reviewComment: z.string().optional(), scheduledReview: z.string().datetime().optional(), });
  • Tool registration definition including name, description, and input schema within the registerEnhancedTools function.
    { name: 'update_document_lifecycle', description: 'Update the lifecycle state of a document with optional review scheduling', inputSchema: { type: 'object', properties: { documentId: { type: 'string', description: 'UUID of the document' }, newState: { type: 'string', enum: ['draft', 'review', 'approved', 'published', 'outdated', 'archived'], description: 'New lifecycle state' }, reviewComment: { type: 'string', description: 'Optional review comment' }, scheduledReview: { type: 'string', description: 'ISO datetime for scheduled review' } }, required: ['documentId', 'newState'] } },

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/Ghostseller/CastPlan_mcp'

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