Skip to main content
Glama

update-label-field

Modify label fields (name or color) in Trello using the specified label ID. Streamline project management with precise label updates via Advanced Trello MCP Server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldYesField to update (name or color)
labelIdYesID of the label to update
valueYesNew value for the field

Implementation Reference

  • Handler function that sends a PUT request to the Trello API to update a specific field (name or color) on the given label ID with the provided value.
    async ({ labelId, field, value }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const url = new URL(`https://api.trello.com/1/labels/${labelId}/${field}`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); url.searchParams.append('value', value); const response = await fetch(url.toString(), { method: 'PUT', headers: { 'Content-Type': 'application/json', }, }); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating label field: ${error}`, }, ], isError: true, }; } }
  • Zod input schema defining the parameters: labelId (string), field (enum: 'name' or 'color'), value (string).
    { labelId: z.string().describe('ID of the label to update'), field: z.enum(['name', 'color']).describe('Field to update (name or color)'), value: z.string().describe('New value for the field') },
  • MCP tool registration for 'update-label-field' within the registerLabelsTools function, which registers multiple label-related tools on the MCP server.
    server.tool( 'update-label-field', { labelId: z.string().describe('ID of the label to update'), field: z.enum(['name', 'color']).describe('Field to update (name or color)'), value: z.string().describe('New value for the field') }, async ({ labelId, field, value }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const url = new URL(`https://api.trello.com/1/labels/${labelId}/${field}`); url.searchParams.append('key', credentials.apiKey); url.searchParams.append('token', credentials.apiToken); url.searchParams.append('value', value); const response = await fetch(url.toString(), { method: 'PUT', headers: { 'Content-Type': 'application/json', }, }); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating label field: ${error}`, }, ], isError: true, }; } } );

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