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
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | Field to update (name or color) | |
| labelId | Yes | ID of the label to update | |
| value | Yes | New value for the field |
Implementation Reference
- src/tools/labels.ts:379-425 (handler)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, }; } }
- src/tools/labels.ts:374-378 (schema)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') },
- src/tools/labels.ts:372-426 (registration)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, }; } } );