launchnotes_update_project_colors
Update color palette and theme for a LaunchNotes project using hex color codes to customize brand colors, text colors, and overall appearance.
Instructions
Update color palette and theme for a LaunchNotes project. All colors must be in hex format (e.g., #FF5733).
Args:
project_id (string): The ID of the project to update
primary_color (string, optional): Primary brand color (hex)
secondary_color (string, optional): Secondary brand color (hex)
primary_text_color (string, optional): Primary text color (hex)
secondary_text_color (string, optional): Secondary text color (hex)
gray_color (string, optional): Gray accent color (hex)
light_gray_color (string, optional): Light gray color (hex)
off_white_color (string, optional): Off-white color (hex)
white_color (string, optional): White color (hex)
supporting_palette (string, optional): Supporting palette configuration
color_theme (string, optional): Overall color theme identifier
At least one color field must be provided. Fields not provided will remain unchanged.
Returns: Confirmation message with updated color fields
Use Cases:
"Change the primary color to #FF5733"
"Update all brand colors for my project"
"Set text colors to improve readability"
"Update the color theme to dark mode"
Error Handling:
Returns validation error if hex colors are invalid
Returns "Project not found" if the project ID doesn't exist
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/projects/tools.ts:298-344 (handler)Handler function that maps optional color parameters to GraphQL update attributes, calls the shared updateProject query, handles GraphQL errors, formats updated fields list, and returns formatted success or error response.async (params: UpdateProjectColorsInput) => { try { const attributes: Record<string, string> = {}; if (params.primary_color !== undefined) attributes.primaryColor = params.primary_color; if (params.secondary_color !== undefined) attributes.secondaryColor = params.secondary_color; if (params.gray_color !== undefined) attributes.grayColor = params.gray_color; if (params.light_gray_color !== undefined) attributes.lightGrayColor = params.light_gray_color; if (params.off_white_color !== undefined) attributes.offWhiteColor = params.off_white_color; if (params.white_color !== undefined) attributes.whiteColor = params.white_color; if (params.primary_text_color !== undefined) attributes.primaryTextColor = params.primary_text_color; if (params.secondary_text_color !== undefined) attributes.secondaryTextColor = params.secondary_text_color; if (params.supporting_palette !== undefined) attributes.supportingPalette = params.supporting_palette; if (params.color_theme !== undefined) attributes.colorTheme = params.color_theme; const result = await updateProject(client, params.project_id, attributes); if (result.updateProject.errors && result.updateProject.errors.length > 0) { const errorMessages = result.updateProject.errors .map((err) => err.message) .join(", "); throw new Error(errorMessages); } const updatedFields = Object.keys(attributes).map(k => k.replace(/([A-Z])/g, " $1").toLowerCase() ).join(", "); return { content: [ { type: "text", text: `✓ Successfully updated colors for project ${params.project_id}\n\nUpdated fields: ${updatedFields}\n\nLast updated: ${result.updateProject.project?.updatedAt}`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error updating project colors: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; }
- src/projects/schemas.ts:95-139 (schema)Zod input schema for the tool with project_id required, optional color fields validated as hex using shared hexColorSchema, optional strings for palette/theme, strict mode, and refine to ensure at least one color field./** * Schema for launchnotes_update_project_colors */ export const UpdateProjectColorsSchema = z .object({ project_id: z .string() .min(1, "Project ID is required") .describe("The ID of the LaunchNotes project to update"), primary_color: hexColorSchema.optional(), secondary_color: hexColorSchema.optional(), gray_color: hexColorSchema.optional(), light_gray_color: hexColorSchema.optional(), off_white_color: hexColorSchema.optional(), white_color: hexColorSchema.optional(), primary_text_color: hexColorSchema.optional(), secondary_text_color: hexColorSchema.optional(), supporting_palette: z .string() .optional() .describe("Supporting color palette configuration"), color_theme: z .string() .optional() .describe("Overall color theme identifier"), }) .strict() .refine( (data) => data.primary_color !== undefined || data.secondary_color !== undefined || data.gray_color !== undefined || data.light_gray_color !== undefined || data.off_white_color !== undefined || data.white_color !== undefined || data.primary_text_color !== undefined || data.secondary_text_color !== undefined || data.supporting_palette !== undefined || data.color_theme !== undefined, { message: "At least one color field must be provided", } ); export type UpdateProjectColorsInput = z.infer<typeof UpdateProjectColorsSchema>;
- src/projects/tools.ts:257-346 (registration)Tool registration via server.registerTool with tool name, detailed title and multi-line description of args/use cases/error handling, reference to UpdateProjectColorsSchema, update-oriented annotations, and inline handler implementation.server.registerTool( "launchnotes_update_project_colors", { title: "Update LaunchNotes Project Colors", description: `Update color palette and theme for a LaunchNotes project. All colors must be in hex format (e.g., #FF5733). Args: - project_id (string): The ID of the project to update - primary_color (string, optional): Primary brand color (hex) - secondary_color (string, optional): Secondary brand color (hex) - primary_text_color (string, optional): Primary text color (hex) - secondary_text_color (string, optional): Secondary text color (hex) - gray_color (string, optional): Gray accent color (hex) - light_gray_color (string, optional): Light gray color (hex) - off_white_color (string, optional): Off-white color (hex) - white_color (string, optional): White color (hex) - supporting_palette (string, optional): Supporting palette configuration - color_theme (string, optional): Overall color theme identifier At least one color field must be provided. Fields not provided will remain unchanged. Returns: Confirmation message with updated color fields Use Cases: - "Change the primary color to #FF5733" - "Update all brand colors for my project" - "Set text colors to improve readability" - "Update the color theme to dark mode" Error Handling: - Returns validation error if hex colors are invalid - Returns "Project not found" if the project ID doesn't exist`, inputSchema: UpdateProjectColorsSchema, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, }, async (params: UpdateProjectColorsInput) => { try { const attributes: Record<string, string> = {}; if (params.primary_color !== undefined) attributes.primaryColor = params.primary_color; if (params.secondary_color !== undefined) attributes.secondaryColor = params.secondary_color; if (params.gray_color !== undefined) attributes.grayColor = params.gray_color; if (params.light_gray_color !== undefined) attributes.lightGrayColor = params.light_gray_color; if (params.off_white_color !== undefined) attributes.offWhiteColor = params.off_white_color; if (params.white_color !== undefined) attributes.whiteColor = params.white_color; if (params.primary_text_color !== undefined) attributes.primaryTextColor = params.primary_text_color; if (params.secondary_text_color !== undefined) attributes.secondaryTextColor = params.secondary_text_color; if (params.supporting_palette !== undefined) attributes.supportingPalette = params.supporting_palette; if (params.color_theme !== undefined) attributes.colorTheme = params.color_theme; const result = await updateProject(client, params.project_id, attributes); if (result.updateProject.errors && result.updateProject.errors.length > 0) { const errorMessages = result.updateProject.errors .map((err) => err.message) .join(", "); throw new Error(errorMessages); } const updatedFields = Object.keys(attributes).map(k => k.replace(/([A-Z])/g, " $1").toLowerCase() ).join(", "); return { content: [ { type: "text", text: `✓ Successfully updated colors for project ${params.project_id}\n\nUpdated fields: ${updatedFields}\n\nLast updated: ${result.updateProject.project?.updatedAt}`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error updating project colors: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], }; } } );