update-label-field
Modify Trello label properties by updating either the name or color field using the label ID and new value.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labelId | Yes | ID of the label to update | |
| field | Yes | Field to update (name or color) | |
| value | Yes | New value for the field |
Implementation Reference
- src/tools/labels.ts:373-426 (handler)The handler function that implements the 'update-label-field' tool logic. It constructs a PUT request to the Trello API endpoint `/labels/{labelId}/{field}` with the value as query param and returns the response or error.'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, }; } } );
- src/tools/labels.ts:375-378 (schema)Zod input schema defining 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/index.ts:91-91 (registration)Invocation of registerLabelsTools which registers the 'update-label-field' tool (and other labels tools) on the MCP server.registerLabelsTools(server, credentials);