archive-card
Archive Trello cards to remove them from active boards while preserving their content for future reference or restoration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cardId | Yes | ID of the card to archive |
Implementation Reference
- src/index.ts:711-757 (handler)The handler function for the 'archive-card' tool. It takes a cardId, checks for Trello API credentials, and makes a PUT request to the Trello API to close (archive) the card. Returns the response or an error.async ({ cardId }) => { try { if (!trelloApiKey || !trelloApiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/cards/${cardId}?key=${trelloApiKey}&token=${trelloApiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ closed: true, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving card: ${error}`, }, ], isError: true, }; } }
- src/index.ts:708-710 (schema)The input schema for the 'archive-card' tool, defining the required 'cardId' parameter using Zod.{ cardId: z.string().describe('ID of the card to archive'), },
- src/index.ts:706-758 (registration)The registration of the 'archive-card' tool using server.tool(), including schema and handler.server.tool( 'archive-card', { cardId: z.string().describe('ID of the card to archive'), }, async ({ cardId }) => { try { if (!trelloApiKey || !trelloApiToken) { return { content: [ { type: 'text', text: 'Trello API credentials are not configured', }, ], isError: true, }; } const response = await fetch( `https://api.trello.com/1/cards/${cardId}?key=${trelloApiKey}&token=${trelloApiToken}`, { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ closed: true, }), } ); const data = await response.json(); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error archiving card: ${error}`, }, ], isError: true, }; } } );