Skip to main content
Glama

create_label

Add a new label to a project board by specifying its title, background color, and text color to organize and categorize tasks.

Instructions

Create a new label on a board

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
board_idYesBoard ID
titleYesLabel title/text
bg_colorYesBackground color (hex) - e.g., #4bce97
colorNoText color (hex) - defaults to #1B2533#1B2533

Implementation Reference

  • The handler function for the 'create_label' tool. It destructures the arguments, prepares the label data, makes a POST request to the API to create the label, and formats the response.
    async (args) => {
      const { board_id, title, bg_color, color } = args;
    
      const labelData: any = {
        label: title,
        bg_color,
        color,
      };
    
      const response = await api.post(
        `/projects/${board_id}/labels`,
        labelData
      );
      return formatResponse(response.data);
    }
  • Registers the 'create_label' tool with the MCP server, providing name, description, input schema, and handler function.
    server.tool(
      "create_label",
      "Create a new label on a board",
      {
        board_id: z.number().int().positive().describe("Board ID"),
        title: z.string().min(1).describe("Label title/text"),
        bg_color: z.string().describe("Background color (hex) - e.g., #4bce97"),
        color: z
          .string()
          .default("#1B2533")
          .describe("Text color (hex) - defaults to #1B2533"),
      },
      async (args) => {
        const { board_id, title, bg_color, color } = args;
    
        const labelData: any = {
          label: title,
          bg_color,
          color,
        };
    
        const response = await api.post(
          `/projects/${board_id}/labels`,
          labelData
        );
        return formatResponse(response.data);
      }
    );
  • Zod schema definition for CreateLabel inputs, matching the inline schema used in the tool registration.
    export const CreateLabelSchema = z.object({
      board_id: z.number().int().positive(),
      title: z.string().min(1),
      bg_color: z.string(),
      color: z.string().default("#1B2533"),
    });
  • src/index.ts:25-25 (registration)
    Calls registerLabelTools to register all label-related tools, including 'create_label', on the MCP server.
    registerLabelTools(server);

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/danieliser/fluent-boards-mcp-server'

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