create-label
Generate and manage labels on Trello boards using board ID, label name, and color. Simplify organization and categorization of tasks directly through the Trello API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boardId | Yes | ID of the board to create the label in | |
| color | Yes | Color of the label | |
| name | Yes | Name of the label |
Implementation Reference
- src/tools/label-tool-handlers.ts:29-32 (handler)The handler function that executes the tool logic by delegating to the LabelService.createLabel method.create_label: async (args: any) => { const labelService = ServiceFactory.getInstance().getLabelService(); return labelService.createLabel(args.boardId, args.name, args.color); },
- src/tools/label-tools.ts:27-49 (schema)The JSON schema definition and metadata for the 'create_label' tool, including input parameters.{ name: "create_label", description: "Create a new label on a board. Use this tool when you need to add a new label to a board for categorizing cards.", inputSchema: { type: "object", properties: { boardId: { type: "string", description: "ID of the board" }, name: { type: "string", description: "Name of the label" }, color: { type: ["string", "null"], enum: ["green", "yellow", "orange", "red", "purple", "blue", "sky", "lime", "pink", "black", null], description: "Color of the label, or null for no color" } }, required: ["boardId", "name", "color"] } },
- src/tools/trello-tool-handlers.ts:8-25 (registration)Registration of labelToolHandlers (including create_label handler) into the combined trelloToolHandlers object used by the MCP server.import { boardToolHandlers } from './board-tool-handlers.js'; import { listToolHandlers } from './list-tool-handlers.js'; import { cardToolHandlers } from './card-tool-handlers.js'; import { memberToolHandlers } from './member-tool-handlers.js'; import { labelToolHandlers } from './label-tool-handlers.js'; import { checklistToolHandlers } from './checklist-tool-handlers.js'; /** * All Trello tool handlers combined into a single object */ export const trelloToolHandlers = { ...boardToolHandlers, ...listToolHandlers, ...cardToolHandlers, ...memberToolHandlers, ...labelToolHandlers, ...checklistToolHandlers };
- src/tools/trello-tools.ts:8-25 (registration)Registration of labelTools (including create_label schema) into the combined trelloTools array used by the MCP server.import { boardTools } from './board-tools.js'; import { listTools } from './list-tools.js'; import { cardTools } from './card-tools.js'; import { memberTools } from './member-tools.js'; import { labelTools } from './label-tools.js'; import { checklistTools } from './checklist-tools.js'; /** * All Trello tools combined into a single array */ export const trelloTools = [ ...boardTools, ...listTools, ...cardTools, ...memberTools, ...labelTools, ...checklistTools ];
- src/services/label-service.ts:41-51 (helper)The underlying service method that performs the actual API call to Trello to create the label.async createLabel( boardId: string, name: string, color: 'green' | 'yellow' | 'orange' | 'red' | 'purple' | 'blue' | 'sky' | 'lime' | 'pink' | 'black' | null ): Promise<TrelloLabel> { return this.trelloService.post<TrelloLabel>('/labels', { idBoard: boardId, name, color }); }