Skip to main content
Glama
jakedx6
by jakedx6

bulk_update_projects

Apply common settings updates to multiple projects simultaneously, including status changes and reasons, to manage project collections efficiently.

Instructions

Update multiple projects at once with common settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idsYesArray of project IDs to update
updatesYesUpdates to apply to all projects
reasonNoReason for bulk update

Implementation Reference

  • The bulkUpdateProjects function is the core handler that parses arguments, loops through project IDs, updates each project via supabaseService.updateProject, handles errors, and returns a summary with results.
    export const bulkUpdateProjects = requireAuth(async (args: any) => { const { project_ids, updates, reason } = BulkUpdateProjectsSchema.parse(args) logger.info('Bulk updating projects', { project_count: project_ids.length, updates, reason }) const results = [] const now = new Date().toISOString() for (const project_id of project_ids) { try { const updateData = { ...updates, updated_at: now, // metadata field doesn't exist in the database schema } const result = await supabaseService.updateProject(project_id, updateData) results.push({ project_id, success: true, project: result }) } catch (error) { logger.error(`Failed to update project ${project_id}:`, error) results.push({ project_id, success: false, error: error instanceof Error ? error.message : 'Unknown error' }) } } const successCount = results.filter(r => r.success).length const failureCount = results.filter(r => !r.success).length return { summary: { total_projects: project_ids.length, successful_updates: successCount, failed_updates: failureCount, success_rate: (successCount / project_ids.length) * 100 }, results, applied_updates: updates } })
  • Zod schema used for input validation inside the handler, defining project_ids (required array), updates (object with optional status), and optional reason.
    const BulkUpdateProjectsSchema = z.object({ project_ids: z.array(z.string().min(1)).min(1), updates: z.object({ status: z.enum(['active', 'completed', 'archived']).optional() // Removed priority, visibility, owner_id as they don't exist in the database schema }), reason: z.string().optional() })
  • MCPTool object registration for 'bulk_update_projects', defining the tool name, description, and JSON input schema for MCP protocol.
    export const bulkUpdateProjectsTool: MCPTool = { name: 'bulk_update_projects', description: 'Update multiple projects at once with common settings', inputSchema: { type: 'object', properties: { project_ids: { type: 'array', items: { type: 'string' }, description: 'Array of project IDs to update' }, updates: { type: 'object', properties: { status: { type: 'string', enum: ['active', 'completed', 'archived'] } // Removed priority, visibility, owner_id as they don't exist in the database schema }, description: 'Updates to apply to all projects' }, reason: { type: 'string', description: 'Reason for bulk update' } }, required: ['project_ids', 'updates'] } }
  • projectHandlers object that maps tool names to their handler functions, including bulk_update_projects: bulkUpdateProjects, likely used for central registration.
    export const projectHandlers = { list_projects: listProjects, get_project: getProject, create_project: createProject, update_project: updateProject, get_project_context: getProjectContext, archive_project: archiveProject, duplicate_project: duplicateProject, get_project_timeline: getProjectTimeline, bulk_update_projects: bulkUpdateProjects }
  • projectTools object exporting all project-related MCPTool objects, including bulkUpdateProjectsTool, for collective registration.
    export const projectTools = { listProjectsTool, getProjectTool, createProjectTool, updateProjectTool, getProjectContextTool, archiveProjectTool, duplicateProjectTool, getProjectTimelineTool, bulkUpdateProjectsTool }

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/jakedx6/helios9-MCP-Server'

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