delete-label
Remove unwanted labels from Trello cards to maintain organized boards and improve visual clarity during project management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| labelId | Yes | ID of the label to delete |
Implementation Reference
- src/tools/labels.ts:325-368 (handler)Handler function that deletes the specified label using Trello API DELETE /labels/{id}, handles credentials check and errors.try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/labels/${labelId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'DELETE', 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 deleting label: ${error}`, }, ], isError: true, }; } }
- src/tools/labels.ts:322-324 (schema)Zod schema for input parameters: labelId (string, ID of the label to delete).labelId: z.string().describe('ID of the label to delete') }, async ({ labelId }) => {
- src/tools/labels.ts:320-369 (registration)Registers the 'delete-label' tool on the MCP server with input schema and inline handler function.'delete-label', { labelId: z.string().describe('ID of the label to delete') }, async ({ labelId }) => { try { if (!credentials.apiKey || !credentials.apiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/labels/${labelId}?key=${credentials.apiKey}&token=${credentials.apiToken}`, { method: 'DELETE', 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 deleting label: ${error}`, }, ], isError: true, }; } } );