Skip to main content
Glama

update-label

Modify Trello card labels by updating their name and color. Change label appearance or remove colors to organize project boards effectively.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelIdYesID of the label to update
nameNoNew name for the label
colorNoNew color for the label (use "null" to remove color)

Implementation Reference

  • Handler function that performs a PUT request to the Trello API to update a label's name and/or color.
    async ({ labelId, name, color }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const updateData: any = {}; if (name !== undefined) updateData.name = name; if (color !== undefined) updateData.color = color === 'null' ? null : color; const response = await fetch( `https://api.trello.com/1/labels/${labelId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(updateData), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating label: ${error}`, }, ], isError: true, }; }
  • Input schema using Zod for validating labelId, optional name, and optional color parameters.
    { labelId: z.string().describe('ID of the label to update'), name: z.string().optional().describe('New name for the label'), color: TrelloColorWithNullEnum.optional().describe('New color for the label (use "null" to remove color)') },
  • Direct registration of the 'update-label' tool using server.tool() within registerLabelsTools.
    server.tool( 'update-label', { labelId: z.string().describe('ID of the label to update'), name: z.string().optional().describe('New name for the label'), color: TrelloColorWithNullEnum.optional().describe('New color for the label (use "null" to remove color)') }, async ({ labelId, name, color }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const updateData: any = {}; if (name !== undefined) updateData.name = name; if (color !== undefined) updateData.color = color === 'null' ? null : color; const response = await fetch( `https://api.trello.com/1/labels/${labelId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(updateData), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating label: ${error}`, }, ], isError: true, }; } } );
  • src/index.ts:91-91 (registration)
    Top-level call to registerLabelsTools, which includes the 'update-label' tool registration.
    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