Skip to main content
Glama

archive-card

Archive Trello cards to remove them from active boards while preserving their content for future reference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIdYesID of the card to archive

Implementation Reference

  • The handler function for the 'archive-card' tool. It sends a PUT request to the Trello API to set the card's 'closed' property to true, effectively archiving it. Includes error handling for missing credentials and API errors.
    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, }; } } );
  • Zod input schema for the 'archive-card' tool, defining the required 'cardId' parameter.
    { cardId: z.string().describe('ID of the card to archive'), },
  • src/index.ts:706-759 (registration)
    Registration of the 'archive-card' tool using server.tool(), including name, input schema, and handler function.
    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, }; } } );

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/praveencs87/trello-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server