Skip to main content
Glama

create-label

Create custom labels in Trello boards by specifying board ID, label name, and color. Enhance organization and categorization of tasks within your Trello projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boardIdYesID of the board to create the label in
colorYesColor of the label
nameYesName of the label

Implementation Reference

  • Handler function that executes the logic for creating a Trello label via API POST request.
    async ({ boardId, name, color }) => { try { const response = await fetch( `https://api.trello.com/1/labels?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ name, color, idBoard: boardId, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating label: ${error}`, }, ], isError: true, }; } }
  • Input schema using Zod for validating boardId, name, and color parameters.
    { boardId: z.string().describe('ID of the board to create the label in'), name: z.string().describe('Name of the label'), color: TrelloColorEnum.describe('Color of the label'), },
  • Direct registration of the 'create-label' tool using server.tool() within registerLabelsTools.
    'create-label', { boardId: z.string().describe('ID of the board to create the label in'), name: z.string().describe('Name of the label'), color: TrelloColorEnum.describe('Color of the label'), }, async ({ boardId, name, color }) => { try { const response = await fetch( `https://api.trello.com/1/labels?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ name, color, idBoard: boardId, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error creating label: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:91-91 (registration)
    Invocation of registerLabelsTools in the main index file, which registers all label tools including 'create-label'.
    registerLabelsTools(server, credentials);

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/adriangrahldev/advanced-trello-mcp-server'

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