edit_label
Modify label titles and color schemes on project boards to improve visual organization and categorization.
Instructions
Edit a label's title and colors
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| board_id | Yes | Board ID | |
| label_id | Yes | Label ID | |
| title | Yes | Label title/text | |
| bg_color | No | Background color (hex) | |
| color | No | Text color (hex) |
Implementation Reference
- src/tools/labels.ts:57-77 (handler)Handler function for 'edit_label' tool: destructures args, conditionally adds bg_color and color to labelData, performs PUT API request to update label, returns formatted response.async (args) => { const { board_id, label_id, title, bg_color, color } = args; const labelData: any = { label: title, }; if (bg_color) { labelData.bg_color = bg_color; } if (color) { labelData.color = color; } const response = await api.put( `/projects/${board_id}/labels/${label_id}`, labelData ); return formatResponse(response.data); }
- src/tools/labels.ts:47-78 (registration)Registers the 'edit_label' MCP tool with server.tool(), providing description, inline Zod input schema, and handler function.server.tool( "edit_label", "Edit a label's title and colors", { board_id: z.number().int().positive().describe("Board ID"), label_id: z.number().int().positive().describe("Label ID"), title: z.string().min(1).describe("Label title/text"), bg_color: z.string().optional().describe("Background color (hex)"), color: z.string().optional().describe("Text color (hex)"), }, async (args) => { const { board_id, label_id, title, bg_color, color } = args; const labelData: any = { label: title, }; if (bg_color) { labelData.bg_color = bg_color; } if (color) { labelData.color = color; } const response = await api.put( `/projects/${board_id}/labels/${label_id}`, labelData ); return formatResponse(response.data); } );
- src/types/index.ts:54-61 (schema)Zod schema definition for EditLabel inputs, matching the inline schema used in the tool registration.export const EditLabelSchema = z.object({ board_id: z.number().int().positive(), label_id: z.number().int().positive(), title: z.string().min(1), bg_color: z.string().optional(), color: z.string().optional(), });
- src/index.ts:25-25 (registration)Top-level registration call that invokes registerLabelTools to add all label tools, including 'edit_label', to the MCP server.registerLabelTools(server);